aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_mysql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_mysql.c')
-rw-r--r--src/datastore/plugin_datastore_mysql.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index ad70e73d4..40f25deee 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -290,7 +290,7 @@ mysql_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t size,
290 unsigned int irepl = replication; 290 unsigned int irepl = replication;
291 unsigned int ipriority = priority; 291 unsigned int ipriority = priority;
292 unsigned int ianonymity = anonymity; 292 unsigned int ianonymity = anonymity;
293 unsigned long long lexpiration = expiration.abs_value; 293 unsigned long long lexpiration = expiration.abs_value_us;
294 unsigned long long lrvalue = 294 unsigned long long lrvalue =
295 (unsigned long long) GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 295 (unsigned long long) GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
296 UINT64_MAX); 296 UINT64_MAX);
@@ -358,12 +358,13 @@ mysql_plugin_update (void *cls, uint64_t uid, int delta,
358{ 358{
359 struct Plugin *plugin = cls; 359 struct Plugin *plugin = cls;
360 unsigned long long vkey = uid; 360 unsigned long long vkey = uid;
361 unsigned long long lexpire = expire.abs_value; 361 unsigned long long lexpire = expire.abs_value_us;
362 int ret; 362 int ret;
363 363
364 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 364 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
365 "Updating value %llu adding %d to priority and maxing exp at %llu\n", 365 "Updating value %llu adding %d to priority and maxing exp at %s\n",
366 vkey, delta, lexpire); 366 vkey, delta,
367 GNUNET_STRINGS_absolute_time_to_string (expire));
367 ret = 368 ret =
368 GNUNET_MYSQL_statement_run_prepared (plugin->mc, plugin->update_entry, NULL, 369 GNUNET_MYSQL_statement_run_prepared (plugin->mc, plugin->update_entry, NULL,
369 MYSQL_TYPE_LONG, &delta, GNUNET_NO, 370 MYSQL_TYPE_LONG, &delta, GNUNET_NO,
@@ -449,11 +450,13 @@ execute_select (struct Plugin *plugin, struct GNUNET_MYSQL_StatementHandle *stmt
449 proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0); 450 proc (proc_cls, NULL, 0, NULL, 0, 0, 0, GNUNET_TIME_UNIT_ZERO_ABS, 0);
450 return; 451 return;
451 } 452 }
453 expiration.abs_value_us = exp;
452 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 454 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
453 "Found %u-byte value under key `%s' with prio %u, anon %u, expire %llu selecting from gn090 table\n", 455 "Found %u-byte value under key `%s' with prio %u, anon %u, expire %s selecting from gn090 table\n",
454 (unsigned int) size, GNUNET_h2s (&key), priority, anonymity, exp); 456 (unsigned int) size, GNUNET_h2s (&key),
457 priority, anonymity,
458 GNUNET_STRINGS_absolute_time_to_string (expiration));
455 GNUNET_assert (size < MAX_DATUM_SIZE); 459 GNUNET_assert (size < MAX_DATUM_SIZE);
456 expiration.abs_value = exp;
457 ret = 460 ret =
458 proc (proc_cls, &key, size, value, type, priority, anonymity, expiration, 461 proc (proc_cls, &key, size, value, type, priority, anonymity, expiration,
459 uid); 462 uid);
@@ -907,7 +910,7 @@ mysql_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
907 rc.plugin = plugin; 910 rc.plugin = plugin;
908 rc.proc = proc; 911 rc.proc = proc;
909 rc.proc_cls = proc_cls; 912 rc.proc_cls = proc_cls;
910 nt = (long long) GNUNET_TIME_absolute_get ().abs_value; 913 nt = (long long) GNUNET_TIME_absolute_get ().abs_value_us;
911 execute_select (plugin, plugin->select_expiration, expi_proc, &rc, 914 execute_select (plugin, plugin->select_expiration, expi_proc, &rc,
912 MYSQL_TYPE_LONGLONG, &nt, GNUNET_YES, -1); 915 MYSQL_TYPE_LONGLONG, &nt, GNUNET_YES, -1);
913 916