aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_sqlite.c
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2011-04-04 17:57:21 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2011-04-04 17:57:21 +0000
commit62e7f41f7f7e4ed467a5abedc333f1ed1eebad5f (patch)
treec44540741af69049b6f1f0f7ea1dd574214d5c3c /src/datastore/plugin_datastore_sqlite.c
parentb9daa50c9f4a643450debc54a78c70cb04fc1328 (diff)
renaming, fixes
git-svn-id: https://gnunet.org/svn/gnunet@14852 140774ce-b5e7-0310-ab8b-a85725594a96
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 501c9f2926..eca82a6fbe 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,
sqlite3_stmt *stmt_2;
char *q;
+ GNUNET_assert (type != GNUNET_BLOCK_TYPE_ANY);
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q,
"SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 "
- "WHERE (prio = ?1 AND expire > %llu AND anonLevel = 0 AND hash < ?2) "
+ "WHERE (prio = ?1 AND expire > %llu AND anonLevel = 0 AND type=%d AND hash < ?2) "
"ORDER BY hash DESC LIMIT 1",
- (unsigned long long) now.abs_value);
+ (unsigned long long) now.abs_value,
+ type);
if (sq_prepare (plugin->dbh, q, &stmt_1) != SQLITE_OK)
{
LOG_SQLITE (plugin, NULL,
@@ -1046,9 +1048,10 @@ sqlite_plugin_iter_zero_anonymity (void *cls,
GNUNET_free (q);
GNUNET_asprintf (&q,
"SELECT type,prio,anonLevel,expire,hash,value,_ROWID_ FROM gn090 "
- "WHERE (prio < ?1 AND expire > %llu AND anonLevel = 0) "
+ "WHERE (prio < ?1 AND expire > %llu AND anonLevel = 0 AND type=%d) "
"ORDER BY prio DESC, hash DESC LIMIT 1",
- (unsigned long long) now.abs_value);
+ (unsigned long long) now.abs_value,
+ type);
if (sq_prepare (plugin->dbh, q, &stmt_2) != SQLITE_OK)
{
LOG_SQLITE (plugin, NULL,