diff options
author | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-04-16 18:54:24 +0200 |
---|---|---|
committer | Cedric Zwahlen <cedric.zwahlen@students.bfh.ch> | 2024-04-19 20:47:34 +0200 |
commit | ba725b627efe5d5a6b4131898c7ee643fce85380 (patch) | |
tree | 01aad63c0e7a12f37e026fc64d1fc8f839fda5ce /src/auditordb/pg_get_fee_time_inconsistency.c | |
parent | 962bcbc6a6bd10f3bbe80766278c36b02f53c7e4 (diff) | |
download | exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.tar.gz exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.tar.bz2 exchange-ba725b627efe5d5a6b4131898c7ee643fce85380.zip |
Fix various CRUD bugs
Diffstat (limited to 'src/auditordb/pg_get_fee_time_inconsistency.c')
-rw-r--r-- | src/auditordb/pg_get_fee_time_inconsistency.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/auditordb/pg_get_fee_time_inconsistency.c b/src/auditordb/pg_get_fee_time_inconsistency.c index 5b1a7aa3f..535bdb422 100644 --- a/src/auditordb/pg_get_fee_time_inconsistency.c +++ b/src/auditordb/pg_get_fee_time_inconsistency.c @@ -105,14 +105,14 @@ TAH_PG_get_fee_time_inconsistency ( TALER_AUDITORDB_FeeTimeInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct FeeTimeInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -133,21 +133,24 @@ TAH_PG_get_fee_time_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_fee_time_inconsistency_get_asc", - "SELECT" - " row_id" - ",type" - ",time" - ",diagnostic" - " FROM auditor_fee_time_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_fee_time_inconsistency_get_asc", + "SELECT" + " row_id" + ",type" + ",time" + ",diagnostic" + " FROM auditor_fee_time_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_fee_time_inconsistency_get_asc" : "auditor_fee_time_inconsistency_get_desc", + (limit > 0) ? + "auditor_fee_time_inconsistency_get_asc" + : + "auditor_fee_time_inconsistency_get_desc", params, &fee_time_inconsistency_cb, &dcc); |