aboutsummaryrefslogtreecommitdiff
path: root/src/dht/plugin_dhtlog_mysql_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/plugin_dhtlog_mysql_dump.c')
-rw-r--r--src/dht/plugin_dhtlog_mysql_dump.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/dht/plugin_dhtlog_mysql_dump.c b/src/dht/plugin_dhtlog_mysql_dump.c
index c71f38c87..ade031c02 100644
--- a/src/dht/plugin_dhtlog_mysql_dump.c
+++ b/src/dht/plugin_dhtlog_mysql_dump.c
@@ -122,6 +122,7 @@ iopen ()
122 return GNUNET_SYSERR; 122 return GNUNET_SYSERR;
123 } 123 }
124#undef PINIT 124#undef PINIT
125
125 return GNUNET_OK; 126 return GNUNET_OK;
126} 127}
127 128
@@ -160,7 +161,8 @@ add_trial (unsigned long long *trialuid, int num_nodes, int topology,
160 int malicious_droppers, char *message) 161 int malicious_droppers, char *message)
161{ 162{
162 int ret; 163 int ret;
163 *trialuid = 0; 164 if (trialuid != NULL)
165 *trialuid = 0;
164 if (outfile == NULL) 166 if (outfile == NULL)
165 return GNUNET_SYSERR; 167 return GNUNET_SYSERR;
166 168
@@ -180,11 +182,11 @@ add_trial (unsigned long long *trialuid, int num_nodes, int topology,
180 if (ret < 0) 182 if (ret < 0)
181 return GNUNET_SYSERR; 183 return GNUNET_SYSERR;
182 ret = fprintf(outfile, "execute insert_trial using " 184 ret = fprintf(outfile, "execute insert_trial using "
183 "@num, @topology, @bl, " 185 "@num, @topology, @t_p, @t_pr,"
184 "@connect, @c_t_o, @c_t_o_m, @t_p, " 186 " @bl, @connect, @c_t_o,"
185 "@t_pr, @puts, @gets, " 187 "@c_t_o_m, @puts, @gets,"
186 "@concurrent, @settle, @rounds, " 188 "@concurrent, @settle, @rounds,"
187 "@m_gets, @m_puts, @m_drops, " 189 "@m_gets, @m_puts, @m_drops,"
188 "@message;\n"); 190 "@message;\n");
189 191
190 ret = fprintf(outfile, "execute select_trial;\n"); 192 ret = fprintf(outfile, "execute select_trial;\n");
@@ -208,7 +210,8 @@ int
208add_dhtkey (unsigned long long *dhtkeyuid, const GNUNET_HashCode * dhtkey) 210add_dhtkey (unsigned long long *dhtkeyuid, const GNUNET_HashCode * dhtkey)
209{ 211{
210 int ret; 212 int ret;
211 *dhtkeyuid = 0; 213 if (dhtkeyuid != NULL)
214 *dhtkeyuid = 0;
212 215
213 if (outfile == NULL) 216 if (outfile == NULL)
214 return GNUNET_SYSERR; 217 return GNUNET_SYSERR;
@@ -330,7 +333,7 @@ add_connections (unsigned long long trialuid, unsigned int totalConnections)
330 if (ret < 0) 333 if (ret < 0)
331 return GNUNET_SYSERR; 334 return GNUNET_SYSERR;
332 335
333 ret = fprintf(outfile, "execute update_connections using @conns;\n"); 336 ret = fprintf(outfile, "execute update_conn using @conns;\n");
334 337
335 if (ret >= 0) 338 if (ret >= 0)
336 return GNUNET_OK; 339 return GNUNET_OK;
@@ -361,7 +364,8 @@ add_query (unsigned long long *sqlqueryuid, unsigned long long queryid,
361 if (outfile == NULL) 364 if (outfile == NULL)
362 return GNUNET_SYSERR; 365 return GNUNET_SYSERR;
363 366
364 *sqlqueryuid = 0; 367 if (sqlqueryuid != NULL)
368 *sqlqueryuid = 0;
365 369
366 if (key != NULL) 370 if (key != NULL)
367 ret = fprintf(outfile, "select dhtkeyuid from dhtkeys where trialuid = @temp_trial and dhtkey = \"%s\" into @temp_dhtkey;\n", GNUNET_h2s_full(key)); 371 ret = fprintf(outfile, "select dhtkeyuid from dhtkeys where trialuid = @temp_trial and dhtkey = \"%s\" into @temp_dhtkey;\n", GNUNET_h2s_full(key));
@@ -413,7 +417,8 @@ add_route (unsigned long long *sqlqueryuid, unsigned long long queryid,
413 if (outfile == NULL) 417 if (outfile == NULL)
414 return GNUNET_SYSERR; 418 return GNUNET_SYSERR;
415 419
416 *sqlqueryuid = 0; 420 if (sqlqueryuid != NULL)
421 *sqlqueryuid = 0;
417 422
418 if (key != NULL) 423 if (key != NULL)
419 ret = fprintf(outfile, "select dhtkeyuid from dhtkeys where trialuid = @temp_trial and dhtkey = \"%s\" into @temp_dhtkey;\n", GNUNET_h2s_full(key)); 424 ret = fprintf(outfile, "select dhtkeyuid from dhtkeys where trialuid = @temp_trial and dhtkey = \"%s\" into @temp_dhtkey;\n", GNUNET_h2s_full(key));