merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 3ea60fbc60932ca411ad31df9dfd18dd1fb26016
parent bcde0fab44e13ef872eb8c414358e5e4613ee3be
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 20 Mar 2017 15:20:46 +0100

fix limit binding

Diffstat:
Msrc/backenddb/plugin_merchantdb_postgres.c | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c @@ -170,7 +170,7 @@ postgres_initialize (void *cls) ",proposal_data BYTEA NOT NULL" ",h_proposal_data BYTEA NOT NULL" ",timestamp INT8 NOT NULL" - ",row_id SERIAL" + ",row_id BIGSERIAL" ",PRIMARY KEY (order_id, merchant_pub)" ");"); @@ -840,19 +840,19 @@ postgres_find_proposal_data_by_date_and_range (void *cls, TALER_MERCHANTDB_ProposalDataCallback cb, void *cb_cls) { - + uint64_t s64 = start; + uint64_t r64 = nrows; struct PostgresClosure *pg = cls; PGresult *result; unsigned int n; - unsigned int i; - struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_absolute_time (&date), GNUNET_PQ_query_param_auto_from_type (merchant_pub), - GNUNET_PQ_query_param_uint32 (&start), - GNUNET_PQ_query_param_uint32 (&nrows), + GNUNET_PQ_query_param_uint64 (&s64), + GNUNET_PQ_query_param_uint64 (&r64), GNUNET_PQ_query_param_end }; + result = GNUNET_PQ_exec_prepared (pg->conn, "find_proposal_data_by_date_and_range", params); @@ -862,12 +862,13 @@ postgres_find_proposal_data_by_date_and_range (void *cls, PQclear (result); return GNUNET_SYSERR; } - if (0 == (n = PQntuples (result)) || NULL == cb) + if ( (0 == (n = PQntuples (result))) || + (NULL == cb) ) { PQclear (result); return n; } - for (i = 0; i < n; i++) + for (unsigned int i = 0; i < n; i++) { char *order_id; json_t *proposal_data;