From f8536e8c14860d121e7b88feb9843756f144a0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Tue, 27 Jun 2023 09:46:31 +0200 Subject: -fix parameter in stored procedures --- src/exchangedb/0002-reserves.sql | 4 ++-- src/exchangedb/exchange_do_batch_withdraw.sql | 4 ++-- src/exchangedb/pg_do_batch_withdraw.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/exchangedb/0002-reserves.sql b/src/exchangedb/0002-reserves.sql index 6ba7f604c..3d345afd5 100644 --- a/src/exchangedb/0002-reserves.sql +++ b/src/exchangedb/0002-reserves.sql @@ -31,7 +31,7 @@ BEGIN ',current_balance_frac INT4 NOT NULL DEFAULT(0)' ',purses_active INT8 NOT NULL DEFAULT(0)' ',purses_allowed INT8 NOT NULL DEFAULT(0)' - ',birthdate INT4 NOT NULL DEFAULT(0)' + ',birthday INT4 NOT NULL DEFAULT(0)' ',expiration_date INT8 NOT NULL' ',gc_date INT8 NOT NULL' ') %s ;' @@ -82,7 +82,7 @@ BEGIN ); PERFORM comment_partitioned_column( 'Birthday of the user in days after 1970, or 0 if user is an adult and is not subject to age restrictions' - ,'birthdate' + ,'birthday' ,table_name ,partition_suffix ); diff --git a/src/exchangedb/exchange_do_batch_withdraw.sql b/src/exchangedb/exchange_do_batch_withdraw.sql index 870137e8e..53e908444 100644 --- a/src/exchangedb/exchange_do_batch_withdraw.sql +++ b/src/exchangedb/exchange_do_batch_withdraw.sql @@ -26,7 +26,7 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_withdraw( OUT reserve_found BOOLEAN, OUT balance_ok BOOLEAN, OUT age_ok BOOLEAN, - OUT allowed_maximum_age INT4, -- in years + OUT allowed_maximum_age INT2, -- in years OUT ruuid INT8) LANGUAGE plpgsql AS $$ @@ -74,7 +74,7 @@ END IF; -- Check if age requirements are present IF ((NOT do_age_check) OR (reserve_birthday = 0)) THEN - age_ok = OK; + age_ok = TRUE; allowed_maximum_age = -1; ELSE -- Age requirements are formally not met: The exchange is setup to support diff --git a/src/exchangedb/pg_do_batch_withdraw.c b/src/exchangedb/pg_do_batch_withdraw.c index 6b5816733..45b1d3229 100644 --- a/src/exchangedb/pg_do_batch_withdraw.c +++ b/src/exchangedb/pg_do_batch_withdraw.c @@ -45,9 +45,9 @@ TEH_PG_do_batch_withdraw ( struct GNUNET_PQ_QueryParam params[] = { TALER_PQ_query_param_amount (amount), GNUNET_PQ_query_param_auto_from_type (reserve_pub), - GNUNET_PQ_query_param_bool (do_age_check), GNUNET_PQ_query_param_timestamp (&now), GNUNET_PQ_query_param_timestamp (&gc), + GNUNET_PQ_query_param_bool (do_age_check), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { @@ -77,10 +77,10 @@ TEH_PG_do_batch_withdraw ( " reserve_found" ",balance_ok" ",age_ok" - ",required_age" + ",allowed_maximum_age" ",ruuid" " FROM exchange_do_batch_withdraw" - " ($1,$2,$3,$4,$5);"); + " ($1,$2,$3,$4,$5,$6);"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "call_batch_withdraw", params, -- cgit v1.2.3