diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-05-01 12:44:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-05-01 12:44:39 +0200 |
commit | a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb (patch) | |
tree | 6eec8a07a9a932d3c7b36f196ad01428e4f0ed63 /src/namestore/plugin_namestore_sqlite.c | |
parent | 8f2f5bc2ee8ebf9b059b7b7e3104f25c5c363458 (diff) | |
download | gnunet-a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb.tar.gz gnunet-a5e3e870f27c8ef3a3cd5d59a686a3050f9c64fb.zip |
more extensive namestore tests for the non-sqlite plugins, with bugfixes
Diffstat (limited to 'src/namestore/plugin_namestore_sqlite.c')
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index b54b4dba2..f62be1e18 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -311,7 +311,7 @@ database_setup (struct Plugin *plugin) | |||
311 | sq_prepare (plugin->dbh, | 311 | sq_prepare (plugin->dbh, |
312 | "SELECT uid,record_count,record_data,label,zone_private_key" | 312 | "SELECT uid,record_count,record_data,label,zone_private_key" |
313 | " FROM ns098records" | 313 | " FROM ns098records" |
314 | " WHERE _rowid_ >= ?" | 314 | " WHERE _rowid_ >= ?" |
315 | " ORDER BY _rowid_ ASC" | 315 | " ORDER BY _rowid_ ASC" |
316 | " LIMIT ?", | 316 | " LIMIT ?", |
317 | &plugin->iterate_all_zones)) || | 317 | &plugin->iterate_all_zones)) || |
@@ -551,7 +551,7 @@ get_records_and_call_iterator (struct Plugin *plugin, | |||
551 | int sret; | 551 | int sret; |
552 | 552 | ||
553 | ret = GNUNET_OK; | 553 | ret = GNUNET_OK; |
554 | for (uint64_t i = 0;i<limit ; i++) | 554 | for (uint64_t i = 0;i<limit;i++) |
555 | { | 555 | { |
556 | sret = sqlite3_step (stmt); | 556 | sret = sqlite3_step (stmt); |
557 | 557 | ||
@@ -570,7 +570,7 @@ get_records_and_call_iterator (struct Plugin *plugin, | |||
570 | ret = GNUNET_SYSERR; | 570 | ret = GNUNET_SYSERR; |
571 | break; | 571 | break; |
572 | } | 572 | } |
573 | 573 | ||
574 | { | 574 | { |
575 | uint64_t seq; | 575 | uint64_t seq; |
576 | uint32_t record_count; | 576 | uint32_t record_count; |
@@ -658,7 +658,7 @@ get_records_and_call_iterator (struct Plugin *plugin, | |||
658 | * @param label name of the record in the zone | 658 | * @param label name of the record in the zone |
659 | * @param iter function to call with the result | 659 | * @param iter function to call with the result |
660 | * @param iter_cls closure for @a iter | 660 | * @param iter_cls closure for @a iter |
661 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | 661 | * @return #GNUNET_OK on success, #GNUNET_NO for no results, else #GNUNET_SYSERR |
662 | */ | 662 | */ |
663 | static int | 663 | static int |
664 | namestore_sqlite_lookup_records (void *cls, | 664 | namestore_sqlite_lookup_records (void *cls, |
@@ -675,7 +675,10 @@ namestore_sqlite_lookup_records (void *cls, | |||
675 | }; | 675 | }; |
676 | 676 | ||
677 | if (NULL == zone) | 677 | if (NULL == zone) |
678 | { | ||
679 | GNUNET_break (0); | ||
678 | return GNUNET_SYSERR; | 680 | return GNUNET_SYSERR; |
681 | } | ||
679 | if (GNUNET_OK != | 682 | if (GNUNET_OK != |
680 | GNUNET_SQ_bind (plugin->lookup_label, | 683 | GNUNET_SQ_bind (plugin->lookup_label, |
681 | params)) | 684 | params)) |