diff options
author | Omar Tarabai <tarabai@devegypt.com> | 2014-06-04 19:03:43 +0000 |
---|---|---|
committer | Omar Tarabai <tarabai@devegypt.com> | 2014-06-04 19:03:43 +0000 |
commit | dd715127aa919fdc66f1854d0db81560d5506d54 (patch) | |
tree | 4491b87b0e26d3e590c49299c3d0eeb4185f24ea /src/peerstore/plugin_peerstore_sqlite.c | |
parent | d5aa4968b0307c3e89db1f6deb6f029d2874f626 (diff) | |
download | gnunet-dd715127aa919fdc66f1854d0db81560d5506d54.tar.gz gnunet-dd715127aa919fdc66f1854d0db81560d5506d54.zip |
peerstore: db index + store test
Diffstat (limited to 'src/peerstore/plugin_peerstore_sqlite.c')
-rw-r--r-- | src/peerstore/plugin_peerstore_sqlite.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/peerstore/plugin_peerstore_sqlite.c b/src/peerstore/plugin_peerstore_sqlite.c index 38e72df51..3dd67024b 100644 --- a/src/peerstore/plugin_peerstore_sqlite.c +++ b/src/peerstore/plugin_peerstore_sqlite.c | |||
@@ -51,8 +51,6 @@ | |||
51 | 51 | ||
52 | #define LOG(kind,...) GNUNET_log_from (kind, "peerstore-sqlite", __VA_ARGS__) | 52 | #define LOG(kind,...) GNUNET_log_from (kind, "peerstore-sqlite", __VA_ARGS__) |
53 | 53 | ||
54 | //FIXME: Indexes | ||
55 | |||
56 | /** | 54 | /** |
57 | * Context for all functions in this plugin. | 55 | * Context for all functions in this plugin. |
58 | */ | 56 | */ |
@@ -459,6 +457,18 @@ database_setup (struct Plugin *plugin) | |||
459 | 457 | ||
460 | sqlite3_create_function(plugin->dbh, "UINT64_LT", 2, SQLITE_UTF8, NULL, &sqlite3_lessthan, NULL, NULL); | 458 | sqlite3_create_function(plugin->dbh, "UINT64_LT", 2, SQLITE_UTF8, NULL, &sqlite3_lessthan, NULL, NULL); |
461 | 459 | ||
460 | /* Create Indices */ | ||
461 | if (SQLITE_OK != | ||
462 | sqlite3_exec(plugin->dbh, | ||
463 | "CREATE INDEX IF NOT EXISTS peerstoredata_key_index ON peerstoredata (sub_system, peer_id, key)", | ||
464 | NULL, NULL, NULL)) | ||
465 | { | ||
466 | LOG (GNUNET_ERROR_TYPE_ERROR, | ||
467 | _("Unable to create indices: %s.\n"), | ||
468 | sqlite3_errmsg (plugin->dbh)); | ||
469 | return GNUNET_SYSERR; | ||
470 | } | ||
471 | |||
462 | /* Prepare statements */ | 472 | /* Prepare statements */ |
463 | 473 | ||
464 | sql_prepare (plugin->dbh, | 474 | sql_prepare (plugin->dbh, |