diff options
Diffstat (limited to 'src/backenddb/plugin_merchantdb_postgres.c')
-rw-r--r-- | src/backenddb/plugin_merchantdb_postgres.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index 93d179fa..af028c72 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -6952,6 +6952,7 @@ postgres_insert_template (void *cls, const struct TALER_MERCHANTDB_TemplateDetails *td) { struct PostgresClosure *pg = cls; + uint32_t pos32 = (uint32_t) td->pos_algorithm; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (instance_id), GNUNET_PQ_query_param_string (template_id), @@ -6959,6 +6960,7 @@ postgres_insert_template (void *cls, (NULL == td->pos_key) ? GNUNET_PQ_query_param_null () : GNUNET_PQ_query_param_string (td->pos_key), + GNUNET_PQ_query_param_uint32 (&pos32), TALER_PQ_query_param_json (td->template_contract), GNUNET_PQ_query_param_end }; @@ -6988,6 +6990,7 @@ postgres_update_template (void *cls, const struct TALER_MERCHANTDB_TemplateDetails *td) { struct PostgresClosure *pg = cls; + uint32_t pos32 = (uint32_t) td->pos_algorithm; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (instance_id), GNUNET_PQ_query_param_string (template_id), @@ -6995,6 +6998,7 @@ postgres_update_template (void *cls, (NULL == td->pos_key) ? GNUNET_PQ_query_param_null () : GNUNET_PQ_query_param_string (td->pos_key), + GNUNET_PQ_query_param_uint32 (&pos32), TALER_PQ_query_param_json (td->template_contract), GNUNET_PQ_query_param_end }; @@ -7151,6 +7155,7 @@ postgres_lookup_template (void *cls, } else { + uint32_t pos32 = (uint32_t) td->pos_algorithm; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_string ("template_description", &td->template_description), @@ -7158,6 +7163,10 @@ postgres_lookup_template (void *cls, GNUNET_PQ_result_spec_string ("pos_key", &td->pos_key), NULL), + GNUNET_PQ_result_spec_allow_null ( + GNUNET_PQ_result_spec_uint32 ("pos_algorithm", + &pos32), + NULL), TALER_PQ_result_spec_json ("template_contract", &td->template_contract), GNUNET_PQ_result_spec_end @@ -10378,6 +10387,7 @@ postgres_connect (void *cls) "SELECT" " template_description" ",pos_key" + ",pos_algorithm" ",template_contract" " FROM merchant_template" " JOIN merchant_instances" @@ -10400,6 +10410,7 @@ postgres_connect (void *cls) ",template_id" ",template_description" ",pos_key" + ",pos_algorithm" ",template_contract" ")" " SELECT merchant_serial," @@ -10411,7 +10422,8 @@ postgres_connect (void *cls) "UPDATE merchant_template SET" " template_description=$3" ",pos_key=$4" - ",template_contract=$5" + ",pos_algorithm=$5" + ",template_contract=$6" " WHERE merchant_serial=" " (SELECT merchant_serial" " FROM merchant_instances" |