diff options
author | Gabor X Toth <*@tg-x.net> | 2016-10-12 21:54:30 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-10-12 21:54:30 +0000 |
commit | b44b31bd94d3a7479e1ab2bf76acd82030455703 (patch) | |
tree | c49e4725ecf389c18b7a65c01e2b8182fa66dcc0 /src/psycstore/plugin_psycstore_mysql.c | |
parent | 7b230386d0b65d4d0e7eded214290d122e96e974 (diff) | |
download | gnunet-b44b31bd94d3a7479e1ab2bf76acd82030455703.tar.gz gnunet-b44b31bd94d3a7479e1ab2bf76acd82030455703.zip |
psycstore: fix postgres
Diffstat (limited to 'src/psycstore/plugin_psycstore_mysql.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_mysql.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/psycstore/plugin_psycstore_mysql.c b/src/psycstore/plugin_psycstore_mysql.c index 71f2eb5b8..01a0282c8 100644 --- a/src/psycstore/plugin_psycstore_mysql.c +++ b/src/psycstore/plugin_psycstore_mysql.c | |||
@@ -296,18 +296,18 @@ database_setup (struct Plugin *plugin) | |||
296 | /* Create tables */ | 296 | /* Create tables */ |
297 | STMT_RUN ("CREATE TABLE IF NOT EXISTS channels (\n" | 297 | STMT_RUN ("CREATE TABLE IF NOT EXISTS channels (\n" |
298 | " id BIGINT UNSIGNED AUTO_INCREMENT,\n" | 298 | " id BIGINT UNSIGNED AUTO_INCREMENT,\n" |
299 | " pub_key BLOB,\n" | 299 | " pub_key BLOB(23),\n" |
300 | " max_state_message_id BIGINT UNSIGNED,\n" | 300 | " max_state_message_id BIGINT UNSIGNED,\n" |
301 | " state_hash_message_id BIGINT UNSIGNED,\n" | 301 | " state_hash_message_id BIGINT UNSIGNED,\n" |
302 | " PRIMARY KEY(id),\n" | 302 | " PRIMARY KEY(id),\n" |
303 | " UNIQUE KEY(pub_key(5))\n" | 303 | " UNIQUE KEY(pub_key(32))\n" |
304 | ");"); | 304 | ");"); |
305 | 305 | ||
306 | STMT_RUN ("CREATE TABLE IF NOT EXISTS slaves (\n" | 306 | STMT_RUN ("CREATE TABLE IF NOT EXISTS slaves (\n" |
307 | " id BIGINT UNSIGNED AUTO_INCREMENT,\n" | 307 | " id BIGINT UNSIGNED AUTO_INCREMENT,\n" |
308 | " pub_key BLOB,\n" | 308 | " pub_key BLOB(32),\n" |
309 | " PRIMARY KEY(id),\n" | 309 | " PRIMARY KEY(id),\n" |
310 | " UNIQUE KEY(pub_key(5))\n" | 310 | " UNIQUE KEY(pub_key(32))\n" |
311 | ");"); | 311 | ");"); |
312 | 312 | ||
313 | STMT_RUN ("CREATE TABLE IF NOT EXISTS membership (\n" | 313 | STMT_RUN ("CREATE TABLE IF NOT EXISTS membership (\n" |
@@ -521,7 +521,7 @@ database_setup (struct Plugin *plugin) | |||
521 | PREP ("SELECT name, value_current\n" | 521 | PREP ("SELECT name, value_current\n" |
522 | "FROM state\n" | 522 | "FROM state\n" |
523 | "WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" | 523 | "WHERE channel_id = (SELECT id FROM channels WHERE pub_key = ?)\n" |
524 | " AND (name = ? OR substr(name, 1, ?) = ? || '_');", | 524 | " AND (name = ? OR substr(name, 1, ?) = ?);", |
525 | &plugin->select_state_prefix); | 525 | &plugin->select_state_prefix); |
526 | 526 | ||
527 | PREP ("SELECT name, value_signed\n" | 527 | PREP ("SELECT name, value_signed\n" |
@@ -905,7 +905,7 @@ static int | |||
905 | message_add_flags (void *cls, | 905 | message_add_flags (void *cls, |
906 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, | 906 | const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, |
907 | uint64_t message_id, | 907 | uint64_t message_id, |
908 | uint64_t psycstore_flags) | 908 | uint32_t psycstore_flags) |
909 | { | 909 | { |
910 | struct Plugin *plugin = cls; | 910 | struct Plugin *plugin = cls; |
911 | struct GNUNET_MYSQL_StatementHandle *stmt = plugin->update_message_flags; | 911 | struct GNUNET_MYSQL_StatementHandle *stmt = plugin->update_message_flags; |
@@ -914,7 +914,7 @@ message_add_flags (void *cls, | |||
914 | int ret = GNUNET_SYSERR; | 914 | int ret = GNUNET_SYSERR; |
915 | 915 | ||
916 | struct GNUNET_MY_QueryParam params_update[] = { | 916 | struct GNUNET_MY_QueryParam params_update[] = { |
917 | GNUNET_MY_query_param_uint64 (&psycstore_flags), | 917 | GNUNET_MY_query_param_uint32 (&psycstore_flags), |
918 | GNUNET_MY_query_param_auto_from_type (channel_key), | 918 | GNUNET_MY_query_param_auto_from_type (channel_key), |
919 | GNUNET_MY_query_param_uint64 (&message_id), | 919 | GNUNET_MY_query_param_uint64 (&message_id), |
920 | GNUNET_MY_query_param_end | 920 | GNUNET_MY_query_param_end |