diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2018-10-15 23:26:58 +0900 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2018-10-15 23:26:58 +0900 |
commit | 1ca9b7ee09328a33f5f428ee3c37acc8479e31fa (patch) | |
tree | 2d1b65e6597be18bf1717fcf1a0ad57d46169317 /src/namestore/plugin_namestore_sqlite.c | |
parent | 116171c281ff6f301198ff9499d158995abaae51 (diff) | |
download | gnunet-1ca9b7ee09328a33f5f428ee3c37acc8479e31fa.tar.gz gnunet-1ca9b7ee09328a33f5f428ee3c37acc8479e31fa.zip |
NAMESTORE: sqlite plugins cleanup
Diffstat (limited to 'src/namestore/plugin_namestore_sqlite.c')
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index a47121082..d9bc5b212 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -152,13 +152,13 @@ database_setup (struct Plugin *plugin) | |||
152 | &plugin->zone_to_name), | 152 | &plugin->zone_to_name), |
153 | GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label" | 153 | GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label" |
154 | " FROM ns098records" | 154 | " FROM ns098records" |
155 | " WHERE zone_private_key=? AND uid >= ?" | 155 | " WHERE zone_private_key=? AND uid > ?" |
156 | " ORDER BY uid ASC" | 156 | " ORDER BY uid ASC" |
157 | " LIMIT ?", | 157 | " LIMIT ?", |
158 | &plugin->iterate_zone), | 158 | &plugin->iterate_zone), |
159 | GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label,zone_private_key" | 159 | GNUNET_SQ_make_prepare ("SELECT uid,record_count,record_data,label,zone_private_key" |
160 | " FROM ns098records" | 160 | " FROM ns098records" |
161 | " WHERE uid >= ?" | 161 | " WHERE uid > ?" |
162 | " ORDER BY uid ASC" | 162 | " ORDER BY uid ASC" |
163 | " LIMIT ?", | 163 | " LIMIT ?", |
164 | &plugin->iterate_all_zones), | 164 | &plugin->iterate_all_zones), |
@@ -627,12 +627,11 @@ namestore_sqlite_iterate_records (void *cls, | |||
627 | struct Plugin *plugin = cls; | 627 | struct Plugin *plugin = cls; |
628 | sqlite3_stmt *stmt; | 628 | sqlite3_stmt *stmt; |
629 | int err; | 629 | int err; |
630 | uint64_t rowid = serial + 1; //SQLite starts counting at 1 | ||
631 | 630 | ||
632 | if (NULL == zone) | 631 | if (NULL == zone) |
633 | { | 632 | { |
634 | struct GNUNET_SQ_QueryParam params[] = { | 633 | struct GNUNET_SQ_QueryParam params[] = { |
635 | GNUNET_SQ_query_param_uint64 (&rowid), | 634 | GNUNET_SQ_query_param_uint64 (&serial), |
636 | GNUNET_SQ_query_param_uint64 (&limit), | 635 | GNUNET_SQ_query_param_uint64 (&limit), |
637 | GNUNET_SQ_query_param_end | 636 | GNUNET_SQ_query_param_end |
638 | }; | 637 | }; |
@@ -645,7 +644,7 @@ namestore_sqlite_iterate_records (void *cls, | |||
645 | { | 644 | { |
646 | struct GNUNET_SQ_QueryParam params[] = { | 645 | struct GNUNET_SQ_QueryParam params[] = { |
647 | GNUNET_SQ_query_param_auto_from_type (zone), | 646 | GNUNET_SQ_query_param_auto_from_type (zone), |
648 | GNUNET_SQ_query_param_uint64 (&rowid), | 647 | GNUNET_SQ_query_param_uint64 (&serial), |
649 | GNUNET_SQ_query_param_uint64 (&limit), | 648 | GNUNET_SQ_query_param_uint64 (&limit), |
650 | GNUNET_SQ_query_param_end | 649 | GNUNET_SQ_query_param_end |
651 | }; | 650 | }; |