summaryrefslogtreecommitdiff
path: root/src/auditordb/plugin_auditordb_postgres.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-15 22:10:12 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-15 22:10:12 +0200
commit0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7 (patch)
treed4f74fb23e802cc6e699892aece5fcc5631df88d /src/auditordb/plugin_auditordb_postgres.c
parenteb354680b45f167ded8b9a6a01090f34d88775f3 (diff)
downloadexchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.tar.gz
exchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.tar.bz2
exchange-0e6c4ba898b0f4c7e53b02a65f99cc4b6b066ad7.zip
work on #5010
Diffstat (limited to 'src/auditordb/plugin_auditordb_postgres.c')
-rw-r--r--src/auditordb/plugin_auditordb_postgres.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/auditordb/plugin_auditordb_postgres.c b/src/auditordb/plugin_auditordb_postgres.c
index f144746a..57f9e89c 100644
--- a/src/auditordb/plugin_auditordb_postgres.c
+++ b/src/auditordb/plugin_auditordb_postgres.c
@@ -1159,16 +1159,13 @@ postgres_gc (void *cls)
* @param cls the @e cls of this struct with the plugin-specific state
* @param session connection to use
* @param issue issuing information with value, fees and other info about the denomination
- * @return #GNUNET_OK on success; #GNUNET_SYSERR on failure
+ * @return operation status result
*/
-static int
+static enum GNUNET_DB_QueryStatus
postgres_insert_denomination_info (void *cls,
struct TALER_AUDITORDB_Session *session,
const struct TALER_DenominationKeyValidityPS *issue)
{
- PGresult *result;
- int ret;
-
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_auto_from_type (&issue->denom_hash),
GNUNET_PQ_query_param_auto_from_type (&issue->master),
@@ -1198,20 +1195,9 @@ postgres_insert_denomination_info (void *cls,
TALER_amount_cmp_currency_nbo (&issue->value,
&issue->fee_refund));
- result = GNUNET_PQ_exec_prepared (session->conn,
- "auditor_denominations_insert",
- params);
- if (PGRES_COMMAND_OK != PQresultStatus (result))
- {
- ret = GNUNET_SYSERR;
- BREAK_DB_ERR (result);
- }
- else
- {
- ret = GNUNET_OK;
- }
- PQclear (result);
- return ret;
+ return GNUNET_PQ_eval_prepared_non_select (session->conn,
+ "auditor_denominations_insert",
+ params);
}
@@ -1237,6 +1223,7 @@ postgres_select_denomination_info (void *cls,
GNUNET_PQ_query_param_end
};
PGresult *result;
+
result = GNUNET_PQ_exec_prepared (session->conn,
"auditor_denominations_select",
params);