aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/plugin_psycstore_mysql.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2016-10-06 16:01:51 +0000
committerGabor X Toth <*@tg-x.net>2016-10-06 16:01:51 +0000
commitda0aae8584e524595e7c17cf3f2cce3090fbb035 (patch)
tree00bbb49044c3febe69e894a9cc14b45ffc1a12e7 /src/psycstore/plugin_psycstore_mysql.c
parenta150b5db213e2fd9474ff7f4a6f639b22ece63ef (diff)
downloadgnunet-da0aae8584e524595e7c17cf3f2cce3090fbb035.tar.gz
gnunet-da0aae8584e524595e7c17cf3f2cce3090fbb035.zip
psycstore: mysql stmt fix, logging for tests
Diffstat (limited to 'src/psycstore/plugin_psycstore_mysql.c')
-rw-r--r--src/psycstore/plugin_psycstore_mysql.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/psycstore/plugin_psycstore_mysql.c b/src/psycstore/plugin_psycstore_mysql.c
index 42c12119e..d857262d6 100644
--- a/src/psycstore/plugin_psycstore_mysql.c
+++ b/src/psycstore/plugin_psycstore_mysql.c
@@ -423,7 +423,7 @@ database_setup (struct Plugin *plugin)
423 " multicast_flags, psycstore_flags, data\n" 423 " multicast_flags, psycstore_flags, data\n"
424 "FROM messages\n" 424 "FROM messages\n"
425 "WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" 425 "WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n"
426 " AND ? <= message_id AND message_id <= ?" 426 " AND ? <= message_id AND message_id <= ?\n"
427 "LIMIT ?;", 427 "LIMIT ?;",
428 &plugin->select_messages); 428 &plugin->select_messages);
429 429
@@ -1101,21 +1101,16 @@ fragment_row (struct GNUNET_MYSQL_StatementHandle *stmt,
1101 1101
1102 1102
1103static int 1103static int
1104fragment_select (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt, 1104fragment_select (struct Plugin *plugin,
1105 struct GNUNET_MYSQL_StatementHandle *stmt,
1105 struct GNUNET_MY_QueryParam *params, 1106 struct GNUNET_MY_QueryParam *params,
1106 uint64_t *returned_fragments, 1107 uint64_t *returned_fragments,
1107 GNUNET_PSYCSTORE_FragmentCallback cb, void *cb_cls) 1108 GNUNET_PSYCSTORE_FragmentCallback cb,
1109 void *cb_cls)
1108{ 1110{
1109 int ret = GNUNET_SYSERR; 1111 int ret = GNUNET_SYSERR;
1110 int sql_ret; 1112 int sql_ret;
1111 1113
1112 // FIXME
1113 if (NULL == plugin->mc || NULL == stmt || NULL == params)
1114 {
1115 fprintf(stderr, "%p %p %p\n", plugin->mc, stmt, params);
1116 return GNUNET_SYSERR;
1117 }
1118
1119 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params); 1114 sql_ret = GNUNET_MY_exec_prepared (plugin->mc, stmt, params);
1120 switch (sql_ret) 1115 switch (sql_ret)
1121 { 1116 {