X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fpsycstore%2Fplugin_psycstore_sqlite.c;h=69291b4406338b5588c19dcbb21507084dedb31a;hb=b14f2e69adb39f4eaaaf3e26a847f29d256a1c68;hp=e6f79597179a422369b91f6ebab9305fddc79f94;hpb=172c9bbdfdd7054663efd59e85e415c7ddafe1be;p=oweals%2Fgnunet.git diff --git a/src/psycstore/plugin_psycstore_sqlite.c b/src/psycstore/plugin_psycstore_sqlite.c index e6f795971..69291b440 100644 --- a/src/psycstore/plugin_psycstore_sqlite.c +++ b/src/psycstore/plugin_psycstore_sqlite.c @@ -348,7 +348,7 @@ database_setup (struct Plugin *plugin) sql_exec (plugin->dbh, "CREATE TABLE IF NOT EXISTS channels (\n" " id INTEGER PRIMARY KEY,\n" - " pub_key BLOB UNIQUE,\n" + " pub_key BLOB(32) UNIQUE,\n" " max_state_message_id INTEGER,\n" // last applied state message ID " state_hash_message_id INTEGER\n" // last message ID with a state hash ");"); @@ -356,7 +356,7 @@ database_setup (struct Plugin *plugin) sql_exec (plugin->dbh, "CREATE TABLE IF NOT EXISTS slaves (\n" " id INTEGER PRIMARY KEY,\n" - " pub_key BLOB UNIQUE\n" + " pub_key BLOB(32) UNIQUE\n" ");"); sql_exec (plugin->dbh, @@ -599,7 +599,7 @@ database_setup (struct Plugin *plugin) "SELECT name, value_current\n" "FROM state\n" "WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" - " AND (name = ? OR substr(name, 1, ?) = ? || '_');", + " AND (name = ? OR substr(name, 1, ?) = ?);", &plugin->select_state_prefix); sql_prepare (plugin->dbh, @@ -998,7 +998,7 @@ static int message_add_flags (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, uint64_t message_id, - uint64_t psycstore_flags) + uint32_t psycstore_flags) { struct Plugin *plugin = cls; sqlite3_stmt *stmt = plugin->update_message_flags; @@ -1773,7 +1773,7 @@ state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_ if (SQLITE_OK != sqlite3_bind_blob (stmt, 1, channel_key, sizeof (*channel_key), SQLITE_STATIC) || SQLITE_OK != sqlite3_bind_text (stmt, 2, name, name_len, SQLITE_STATIC) - || SQLITE_OK != sqlite3_bind_int (stmt, 3, name_len + 1) + || SQLITE_OK != sqlite3_bind_int (stmt, 3, name_len) || SQLITE_OK != sqlite3_bind_text (stmt, 4, name, name_len, SQLITE_STATIC)) { LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,