commit 7c46fcf009916f48677ef418abc5b180bac68135 parent ef16910b6e480a87cf70e7e8c23d1b5e1ebd3d52 Author: Christian Grothoff <christian@grothoff.org> Date: Tue, 2 Jun 2026 19:07:05 +0200 -fix misc. minor bugs Diffstat:
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c @@ -562,8 +562,7 @@ handle_mhd_request (void *cls, .url = "donation-statement", .method = MHD_HTTP_METHOD_GET, .handler.get = &DH_handler_get_donation_statement, - .nargs = 2, - .nargs_is_upper_bound = true + .nargs = 2 }, /* mark end of list */ { diff --git a/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c b/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c @@ -371,9 +371,8 @@ start: NULL); } GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "public key value: %lu.%u\n", - dk->value.value, - dk->value.fraction); + "public key value: %s\n", + TALER_amount2s (&dk->value)); GNUNET_assert (0 <= TALER_amount_add (&receipts_sum, &receipts_sum, &dk->value)); diff --git a/src/donaudb/donau_do_insert_issued_receipts.sql b/src/donaudb/donau_do_insert_issued_receipts.sql @@ -48,7 +48,7 @@ BEGIN -- check if the new receipts to date is below or equal the limit for the charity IF ( (max_per_year.val > new_receipts_to_date.val) OR ( (max_per_year.val = new_receipts_to_date.val) AND - (max_per_year.frac > new_receipts_to_date.frac) ) ) + (max_per_year.frac >= new_receipts_to_date.frac) ) ) THEN out_smaller_than_max_per_year=TRUE; UPDATE charities diff --git a/src/donaudb/insert_submitted_receipts.c b/src/donaudb/insert_submitted_receipts.c @@ -92,8 +92,8 @@ DONAUDB_insert_submitted_receipts (struct DONAUDB_PostgresContext *ctx, if (conflicted[i]) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Submitted donation receipt at index %ld already present!\n", - i); + "Submitted donation receipt at index %llu already present!\n", + (unsigned long long) i); } } } diff --git a/src/donaudb/iterate_submitted_receipts.c b/src/donaudb/iterate_submitted_receipts.c @@ -53,8 +53,8 @@ DONAUDB_iterate_submitted_receipts ( PREPARE (ctx, "lookup_submitted_receipts", "SELECT " - " CAST(SUM((donation_units.value).val) AS INT8) AS valueSum" - ",CAST(SUM(CAST((donation_units.value).frac AS INT8)) AS INT8) AS fractionSum" + " COALESCE(CAST(SUM((donation_units.value).val) AS INT8),0) AS valueSum" + ",COALESCE(CAST(SUM(CAST((donation_units.value).frac AS INT8)) AS INT8),0) AS fractionSum" " FROM receipts_submitted ref" " JOIN donation_units USING (h_donation_unit_pub)" " WHERE donation_year=$1" @@ -71,5 +71,7 @@ DONAUDB_iterate_submitted_receipts ( total_donations); total_donations->value = valueSum; total_donations->fraction = fractionSum; + if (TALER_amount_is_zero (total_donations)) + return GNUNET_DB_STATUS_SUCCESS_NO_RESULTS; return qs; }