diff options
author | Gabor X Toth <*@tg-x.net> | 2016-10-12 16:41:36 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-10-12 16:41:36 +0000 |
commit | dc9705745ba0118859be9b547491fc5d2d5cba09 (patch) | |
tree | aa6124b1da240ae25c2f8d36c1dfc72a9a3071d9 /src/psycstore/plugin_psycstore_postgres.c | |
parent | 7b0570f80f6d176f760fca0a79e439ee84e7c5a9 (diff) |
psycstore/postgres: fix return value checks, use template1 db for tests
Diffstat (limited to 'src/psycstore/plugin_psycstore_postgres.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_postgres.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c index 2bf7e894e5..244b582a80 100644 --- a/src/psycstore/plugin_psycstore_postgres.c +++ b/src/psycstore/plugin_psycstore_postgres.c @@ -713,7 +713,7 @@ membership_test (void *cls, if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, res, - PGRES_COMMAND_OK, + PGRES_TUPLES_OK, "PQexecPrepared", "select_membership")) { return GNUNET_SYSERR; @@ -835,9 +835,9 @@ message_add_flags (void *cls, res = GNUNET_PQ_exec_prepared (plugin->dbh, "update_message_flags", params_update); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", "update_message_flags")) + res, + PGRES_COMMAND_OK, + "PQexecPrepared","update_message_flags")) return ret; PQclear (res); @@ -952,7 +952,7 @@ fragment_select (struct Plugin *plugin, if (GNUNET_YES == GNUNET_POSTGRES_check_result (plugin->dbh, res, - PGRES_COMMAND_OK, + PGRES_TUPLES_OK, "PQexecPrepared", stmt)) { if (PQntuples (res) == 0) @@ -1118,9 +1118,9 @@ message_get_fragment (void *cls, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK == GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_TUPLES_OK, + "PQexecPrepared", stmt)) { if (PQntuples (res) == 0) ret = GNUNET_NO; @@ -1159,9 +1159,9 @@ counters_message_get (void *cls, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_TUPLES_OK, + "PQexecPrepared", stmt)) { return GNUNET_SYSERR; } @@ -1212,9 +1212,9 @@ counters_state_get (void *cls, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_TUPLES_OK, + "PQexecPrepared", stmt)) { return GNUNET_SYSERR; } @@ -1261,9 +1261,9 @@ state_assign (struct Plugin *plugin, const char *stmt, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_COMMAND_OK, + "PQexecPrepared", stmt)) { return GNUNET_SYSERR; } @@ -1289,9 +1289,9 @@ update_message_id (struct Plugin *plugin, const char *stmt, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_COMMAND_OK, + "PQexecPrepared", stmt)) { return GNUNET_SYSERR; } @@ -1529,9 +1529,9 @@ state_get (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, - res, - PGRES_COMMAND_OK, - "PQexecPrepared", stmt)) + res, + PGRES_TUPLES_OK, + "PQexecPrepared", stmt)) { return GNUNET_SYSERR; } @@ -1604,7 +1604,7 @@ state_get_prefix (void *cls, const struct GNUNET_CRYPTO_EddsaPublicKey *channel_ res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, res, - PGRES_COMMAND_OK, + PGRES_TUPLES_OK, "PQexecPrepared", stmt)) { break; @@ -1674,7 +1674,7 @@ state_get_signed (void *cls, res = GNUNET_PQ_exec_prepared (plugin->dbh, stmt, params_select); if (GNUNET_OK != GNUNET_POSTGRES_check_result (plugin->dbh, res, - PGRES_COMMAND_OK, + PGRES_TUPLES_OK, "PQexecPrepared", stmt)) { break; |