diff options
Diffstat (limited to 'src/auditordb/pg_get_row_minor_inconsistencies.c')
-rw-r--r-- | src/auditordb/pg_get_row_minor_inconsistencies.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/auditordb/pg_get_row_minor_inconsistencies.c b/src/auditordb/pg_get_row_minor_inconsistencies.c index 002abbda3..e282f7ea3 100644 --- a/src/auditordb/pg_get_row_minor_inconsistencies.c +++ b/src/auditordb/pg_get_row_minor_inconsistencies.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct RowMinorInconsistenciesContext */ static void row_minor_inconsistencies_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct RowMinorInconsistenciesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,9 +76,9 @@ row_minor_inconsistencies_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("row_table", &dc.row_table), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("row_table", &dc.row_table), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -119,12 +116,12 @@ TAH_PG_get_row_minor_inconsistencies ( TALER_AUDITORDB_RowMinorInconsistenciesCallback 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_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct RowMinorInconsistenciesContext dcc = { @@ -138,9 +135,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_desc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -151,9 +148,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_asc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -162,8 +159,10 @@ TAH_PG_get_row_minor_inconsistencies ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_row_minor_inconsistencies_get_asc" - : "auditor_row_minor_inconsistencies_get_desc", + ? + "auditor_row_minor_inconsistencies_get_asc" + : + "auditor_row_minor_inconsistencies_get_desc", params, &row_minor_inconsistencies_cb, &dcc); @@ -173,6 +172,3 @@ TAH_PG_get_row_minor_inconsistencies ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file |