aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_sqlite.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-04-04 17:57:21 +0000
committerChristian Grothoff <christian@grothoff.org>2011-04-04 17:57:21 +0000
commit2663c23e2b0944dfb015332f10ff65cfc802588a (patch)
treec44540741af69049b6f1f0f7ea1dd574214d5c3c /src/datastore/plugin_datastore_sqlite.c
parent060e3c202b9c4aed542617ac84b6b3061f51be2b (diff)
downloadgnunet-2663c23e2b0944dfb015332f10ff65cfc802588a.tar.gz
gnunet-2663c23e2b0944dfb015332f10ff65cfc802588a.zip
renaming, fixes
Diffstat (limited to 'src/datastore/plugin_datastore_sqlite.c')
-rw-r--r--src/datastore/plugin_datastore_sqlite.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index 501c9f292..eca82a6fb 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -1028,12 +1028,14 @@ sqlite_plugin_iter_zero_anonymity (void *cls,
1028 sqlite3_stmt *stmt_2; 1028 sqlite3_stmt *stmt_2;
1029 char *q; 1029 char *q;
1030 1030
1031 GNUNET_assert (type != GNUNET_BLOCK_TYPE_ANY);
1031 now = GNUNET_TIME_absolute_get (); 1032 now = GNUNET_TIME_absolute_get ();
1032 GNUNET_asprintf (&q, 1033 GNUNET_asprintf (&q,
1033 "SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 " 1034 "SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 "
1034 "WHERE (prio = ?1 AND expire > %llu AND anonLevel = 0 AND hash < ?2) " 1035 "WHERE (prio = ?1 AND expire > %llu AND anonLevel = 0 AND type=%d AND hash < ?2) "
1035 "ORDER BY hash DESC LIMIT 1", 1036 "ORDER BY hash DESC LIMIT 1",
1036 (unsigned long long) now.abs_value); 1037 (unsigned long long) now.abs_value,
1038 type);
1037 if (sq_prepare (plugin->dbh, q, &stmt_1) != SQLITE_OK) 1039 if (sq_prepare (plugin->dbh, q, &stmt_1) != SQLITE_OK)
1038 { 1040 {
1039 LOG_SQLITE (plugin, NULL, 1041 LOG_SQLITE (plugin, NULL,
@@ -1046,9 +1048,10 @@ sqlite_plugin_iter_zero_anonymity (void *cls,
1046 GNUNET_free (q); 1048 GNUNET_free (q);
1047 GNUNET_asprintf (&q, 1049 GNUNET_asprintf (&q,
1048 "SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 " 1050 "SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 "
1049 "WHERE (prio < ?1 AND expire > %llu AND anonLevel = 0) " 1051 "WHERE (prio < ?1 AND expire > %llu AND anonLevel = 0 AND type=%d) "
1050 "ORDER BY prio DESC, hash DESC LIMIT 1", 1052 "ORDER BY prio DESC, hash DESC LIMIT 1",
1051 (unsigned long long) now.abs_value); 1053 (unsigned long long) now.abs_value,
1054 type);
1052 if (sq_prepare (plugin->dbh, q, &stmt_2) != SQLITE_OK) 1055 if (sq_prepare (plugin->dbh, q, &stmt_2) != SQLITE_OK)
1053 { 1056 {
1054 LOG_SQLITE (plugin, NULL, 1057 LOG_SQLITE (plugin, NULL,