diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2024-08-18 22:50:06 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2024-08-18 22:50:06 +0200 |
commit | 80449fc3232558e2f8a0aacfc2dab805216806aa (patch) | |
tree | 2f20032595d2070814f9d93279c64f3bd3cec333 /src/auditordb | |
parent | ffecacae4b60206564f2278f260bc3c5a4077cea (diff) |
more FTBFS fixes
Diffstat (limited to 'src/auditordb')
-rw-r--r-- | src/auditordb/pg_get_denomination_pending.c | 10 | ||||
-rw-r--r-- | src/auditordb/pg_get_emergency_by_count.c | 21 | ||||
-rw-r--r-- | src/auditordb/pg_get_misattribution_in_inconsistency.c | 19 | ||||
-rw-r--r-- | src/auditordb/pg_get_purses.c | 25 | ||||
-rw-r--r-- | src/auditordb/pg_get_reserves.c | 17 | ||||
-rw-r--r-- | src/auditordb/pg_insert_denomination_pending.c | 5 | ||||
-rw-r--r-- | src/auditordb/pg_insert_emergency_by_count.c | 10 | ||||
-rw-r--r-- | src/auditordb/pg_insert_misattribution_in_inconsistency.c | 10 | ||||
-rw-r--r-- | src/auditordb/pg_insert_purses.c | 8 | ||||
-rw-r--r-- | src/auditordb/pg_insert_row_inconsistency.c | 7 |
10 files changed, 33 insertions, 99 deletions
diff --git a/src/auditordb/pg_get_denomination_pending.c b/src/auditordb/pg_get_denomination_pending.c index 9ff92abef..02ef99fe2 100644 --- a/src/auditordb/pg_get_denomination_pending.c +++ b/src/auditordb/pg_get_denomination_pending.c @@ -69,22 +69,16 @@ denomination_pending_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { uint64_t serial_id; - struct TALER_AUDITORDB_DenominationPending dc; - struct GNUNET_PQ_ResultSpec rs[] = { - GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &dc.denom_pub_hash), TALER_PQ_RESULT_SPEC_AMOUNT ("denom_balance", &dc.denom_balance), TALER_PQ_RESULT_SPEC_AMOUNT ("denom_loss", &dc.denom_loss), - GNUNET_PQ_result_spec_int64 ("num_issued", &dc.num_issued), + GNUNET_PQ_result_spec_uint64 ("num_issued", &dc.num_issued), TALER_PQ_RESULT_SPEC_AMOUNT ("denom_risk", &dc.denom_risk), TALER_PQ_RESULT_SPEC_AMOUNT ("recoup_loss", &dc.recoup_loss), - - GNUNET_PQ_result_spec_end }; enum GNUNET_GenericReturnValue rval; @@ -98,9 +92,7 @@ denomination_pending_cb (void *cls, dcc->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } - dcc->qs = i + 1; - rval = dcc->cb (dcc->cb_cls, serial_id, &dc); diff --git a/src/auditordb/pg_get_emergency_by_count.c b/src/auditordb/pg_get_emergency_by_count.c index d141b81e3..eecc6594e 100644 --- a/src/auditordb/pg_get_emergency_by_count.c +++ b/src/auditordb/pg_get_emergency_by_count.c @@ -71,20 +71,16 @@ emergency_by_count_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { uint64_t serial_id; - struct TALER_AUDITORDB_EmergenciesByCount dc; - struct GNUNET_PQ_ResultSpec rs[] = { - GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), GNUNET_PQ_result_spec_auto_from_type ("denompub_h", &dc.denompub_h), - GNUNET_PQ_result_spec_int64 ("num_issued", &dc.num_issued), - GNUNET_PQ_result_spec_int64 ("num_known", &dc.num_known), + GNUNET_PQ_result_spec_uint64 ("num_issued", &dc.num_issued), + GNUNET_PQ_result_spec_uint64 ("num_known", &dc.num_known), TALER_PQ_RESULT_SPEC_AMOUNT ("risk", &dc.risk), GNUNET_PQ_result_spec_absolute_time ("start", &dc.start), GNUNET_PQ_result_spec_absolute_time ("deposit_end", &dc.deposit_end), TALER_PQ_RESULT_SPEC_AMOUNT ("value", &dc.value), - GNUNET_PQ_result_spec_end }; enum GNUNET_GenericReturnValue rval; @@ -98,9 +94,7 @@ emergency_by_count_cb (void *cls, dcc->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } - dcc->qs = i + 1; - rval = dcc->cb (dcc->cb_cls, serial_id, &dc); @@ -120,9 +114,7 @@ TAH_PG_get_emergency_by_count ( TALER_AUDITORDB_EmergenciesByCountCallback 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), @@ -172,15 +164,16 @@ TAH_PG_get_emergency_by_count ( " LIMIT $3" ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? + (limit > 0) + ? "auditor_emergency_by_count_get_asc" - : "auditor_emergency_by_count_get_desc", + : + "auditor_emergency_by_count_get_desc", params, &emergency_by_count_cb, &dcc); - if (qs > 0) return dcc.qs; GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; -}
\ No newline at end of file +} diff --git a/src/auditordb/pg_get_misattribution_in_inconsistency.c b/src/auditordb/pg_get_misattribution_in_inconsistency.c index a091c9b64..1b31d1a4e 100644 --- a/src/auditordb/pg_get_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_get_misattribution_in_inconsistency.c @@ -69,19 +69,13 @@ misattribution_in_inconsistency_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { uint64_t serial_id; - struct TALER_AUDITORDB_MisattributionInInconsistency dc; - struct GNUNET_PQ_ResultSpec rs[] = { - GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - - TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), - GNUNET_PQ_result_spec_int64 ("bank_row", &dc.bank_row), - GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), - GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), - - + TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), + GNUNET_PQ_result_spec_uint64 ("bank_row", &dc.bank_row), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end }; enum GNUNET_GenericReturnValue rval; @@ -95,9 +89,7 @@ misattribution_in_inconsistency_cb (void *cls, dcc->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } - dcc->qs = i + 1; - rval = dcc->cb (dcc->cb_cls, serial_id, &dc); @@ -169,7 +161,8 @@ TAH_PG_get_misattribution_in_inconsistency ( : "auditor_misattribution_in_inconsistency_get_desc", params, - &misattribution_in_inconsistency_cb, + &misattribution_in_inconsistency_cb + , &dcc); if (qs > 0) diff --git a/src/auditordb/pg_get_purses.c b/src/auditordb/pg_get_purses.c index 44ef4d91b..b415d9aad 100644 --- a/src/auditordb/pg_get_purses.c +++ b/src/auditordb/pg_get_purses.c @@ -13,14 +13,11 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - - #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" #include "taler_pq_lib.h" #include "pg_helper.h" - #include "pg_get_purses.h" @@ -68,20 +65,18 @@ purses_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { - struct TALER_AUDITORDB_Purses dc; - struct GNUNET_PQ_ResultSpec rs[] = { - - GNUNET_PQ_result_spec_int64 ("auditor_purses_rowid", - &dc.auditor_purses_rowid), - GNUNET_PQ_result_spec_auto_from_type ("purse_pub", &dc.purse_pub), - TALER_PQ_RESULT_SPEC_AMOUNT ("balance", &dc.balance), - TALER_PQ_RESULT_SPEC_AMOUNT ("target", &dc.target), + GNUNET_PQ_result_spec_uint64 ("auditor_purses_rowid", + &dc.auditor_purses_rowid), + GNUNET_PQ_result_spec_auto_from_type ("purse_pub", + &dc.purse_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", + &dc.balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("target", + &dc.target), GNUNET_PQ_result_spec_absolute_time ("expiration_date", &dc.expiration_date), - - GNUNET_PQ_result_spec_end }; enum GNUNET_GenericReturnValue rval; @@ -95,9 +90,7 @@ purses_cb (void *cls, dcc->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } - dcc->qs = i + 1; - rval = dcc->cb (dcc->cb_cls, dc.auditor_purses_rowid, &dc); @@ -117,9 +110,7 @@ TAH_PG_get_purses ( TALER_AUDITORDB_PursesCallback 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), diff --git a/src/auditordb/pg_get_reserves.c b/src/auditordb/pg_get_reserves.c index dae01b547..32247c4ec 100644 --- a/src/auditordb/pg_get_reserves.c +++ b/src/auditordb/pg_get_reserves.c @@ -13,14 +13,11 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - - #include "platform.h" #include "taler_error_codes.h" #include "taler_dbevents.h" #include "taler_pq_lib.h" #include "pg_helper.h" - #include "pg_get_reserves.h" @@ -68,13 +65,10 @@ reserves_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { - struct TALER_AUDITORDB_Reserves dc; - struct GNUNET_PQ_ResultSpec rs[] = { - - GNUNET_PQ_result_spec_int64 ("auditor_reserves_rowid", - &dc.auditor_reserves_rowid), + GNUNET_PQ_result_spec_uint64 ("auditor_reserves_rowid", + &dc.auditor_reserves_rowid), GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_balance", &dc.reserve_balance), TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_loss", &dc.reserve_loss), @@ -88,8 +82,6 @@ reserves_cb (void *cls, GNUNET_PQ_result_spec_absolute_time ("expiration_date", &dc.expiration_date), GNUNET_PQ_result_spec_string ("origin_account", &dc.origin_account), - - GNUNET_PQ_result_spec_end }; enum GNUNET_GenericReturnValue rval; @@ -103,9 +95,7 @@ reserves_cb (void *cls, dcc->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } - dcc->qs = i + 1; - rval = dcc->cb (dcc->cb_cls, dc.auditor_reserves_rowid, &dc); @@ -125,9 +115,7 @@ TAH_PG_get_reserves ( TALER_AUDITORDB_ReservesCallback 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), @@ -186,7 +174,6 @@ TAH_PG_get_reserves ( params, &reserves_cb, &dcc); - if (qs > 0) return dcc.qs; GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); diff --git a/src/auditordb/pg_insert_denomination_pending.c b/src/auditordb/pg_insert_denomination_pending.c index d1fa00ef3..cdd8c5bec 100644 --- a/src/auditordb/pg_insert_denomination_pending.c +++ b/src/auditordb/pg_insert_denomination_pending.c @@ -28,15 +28,12 @@ TAH_PG_insert_denomination_pending ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (&dc->denom_pub_hash), TALER_PQ_query_param_amount (pg->conn, &dc->denom_balance), TALER_PQ_query_param_amount (pg->conn, &dc->denom_loss), - GNUNET_PQ_query_param_int64 (&dc->num_issued), + GNUNET_PQ_query_param_uint64 (&dc->num_issued), TALER_PQ_query_param_amount (pg->conn, &dc->denom_risk), TALER_PQ_query_param_amount (pg->conn, &dc->recoup_loss), - - GNUNET_PQ_query_param_end }; diff --git a/src/auditordb/pg_insert_emergency_by_count.c b/src/auditordb/pg_insert_emergency_by_count.c index 2cebc8cac..fe5de116b 100644 --- a/src/auditordb/pg_insert_emergency_by_count.c +++ b/src/auditordb/pg_insert_emergency_by_count.c @@ -13,13 +13,9 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - - #include "platform.h" #include "taler_pq_lib.h" #include "pg_helper.h" - - #include "pg_insert_emergency_by_count.h" enum GNUNET_DB_QueryStatus @@ -29,15 +25,13 @@ TAH_PG_insert_emergency_by_count ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (&dc->denompub_h), - GNUNET_PQ_query_param_int64 (&dc->num_issued), - GNUNET_PQ_query_param_int64 (&dc->num_known), + GNUNET_PQ_query_param_uint64 (&dc->num_issued), + GNUNET_PQ_query_param_uint64 (&dc->num_known), TALER_PQ_query_param_amount (pg->conn, &dc->risk), GNUNET_PQ_query_param_absolute_time (&dc->start), GNUNET_PQ_query_param_absolute_time (&dc->deposit_end), TALER_PQ_query_param_amount (pg->conn, &dc->value), - GNUNET_PQ_query_param_end }; diff --git a/src/auditordb/pg_insert_misattribution_in_inconsistency.c b/src/auditordb/pg_insert_misattribution_in_inconsistency.c index 843b8933e..1db7d86d6 100644 --- a/src/auditordb/pg_insert_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_insert_misattribution_in_inconsistency.c @@ -13,12 +13,9 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - - #include "platform.h" #include "taler_pq_lib.h" #include "pg_helper.h" - #include "pg_insert_misattribution_in_inconsistency.h" enum GNUNET_DB_QueryStatus @@ -28,19 +25,16 @@ TAH_PG_insert_misattribution_in_inconsistency ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount (pg->conn, &dc->amount), - GNUNET_PQ_query_param_int64 (&dc->bank_row), + GNUNET_PQ_query_param_uint64 (&dc->bank_row), GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), - - GNUNET_PQ_query_param_end }; PREPARE (pg, "auditor_misattribution_in_inconsistency_insert", "INSERT INTO auditor_misattribution_in_inconsistency " - "( row_id," + "(row_id," " amount," " bank_row," " reserve_pub" diff --git a/src/auditordb/pg_insert_purses.c b/src/auditordb/pg_insert_purses.c index 2bbf096fe..b751a6caf 100644 --- a/src/auditordb/pg_insert_purses.c +++ b/src/auditordb/pg_insert_purses.c @@ -13,12 +13,9 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - - #include "platform.h" #include "taler_pq_lib.h" #include "pg_helper.h" - #include "pg_insert_purses.h" enum GNUNET_DB_QueryStatus @@ -28,14 +25,11 @@ TAH_PG_insert_purses ( { struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - - GNUNET_PQ_query_param_int64 (&dc->auditor_purses_rowid), + GNUNET_PQ_query_param_uint64 (&dc->auditor_purses_rowid), GNUNET_PQ_query_param_auto_from_type (&dc->purse_pub), TALER_PQ_query_param_amount (pg->conn, &dc->balance), TALER_PQ_query_param_amount (pg->conn, &dc->target), GNUNET_PQ_query_param_absolute_time (&dc->expiration_date), - - GNUNET_PQ_query_param_end }; diff --git a/src/auditordb/pg_insert_row_inconsistency.c b/src/auditordb/pg_insert_row_inconsistency.c index d9155d68c..119b7fa34 100644 --- a/src/auditordb/pg_insert_row_inconsistency.c +++ b/src/auditordb/pg_insert_row_inconsistency.c @@ -25,11 +25,10 @@ TAH_PG_insert_row_inconsistency ( const struct TALER_AUDITORDB_RowInconsistency *dc) { struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_string (dc->row_table), GNUNET_PQ_query_param_string (dc->diagnostic), + GNUNET_PQ_query_param_uint64 (&dc->row_id), GNUNET_PQ_query_param_end }; @@ -38,8 +37,8 @@ TAH_PG_insert_row_inconsistency ( "INSERT INTO auditor_row_inconsistency " "(row_table" ",diagnostic" - ") VALUES ($1,$2);"); - + ",problem_row_id" + ") VALUES ($1,$2,$3);"); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_deposit_confirmation_insert", params); |