summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-20 15:20:46 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-20 15:20:46 +0100
commit3ea60fbc60932ca411ad31df9dfd18dd1fb26016 (patch)
tree874adfdb9447017bff6681bfff23f6a07b18e01c
parentbcde0fab44e13ef872eb8c414358e5e4613ee3be (diff)
downloadmerchant-3ea60fbc60932ca411ad31df9dfd18dd1fb26016.tar.gz
merchant-3ea60fbc60932ca411ad31df9dfd18dd1fb26016.tar.bz2
merchant-3ea60fbc60932ca411ad31df9dfd18dd1fb26016.zip
fix limit binding
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 8d620574..afd6e8ec 100644
--- 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;