-fix parameter in stored procedures

This commit is contained in:
Özgür Kesim 2023-06-27 09:46:31 +02:00
parent 145310e20e
commit f8536e8c14
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7
3 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ BEGIN
',current_balance_frac INT4 NOT NULL DEFAULT(0)' ',current_balance_frac INT4 NOT NULL DEFAULT(0)'
',purses_active INT8 NOT NULL DEFAULT(0)' ',purses_active INT8 NOT NULL DEFAULT(0)'
',purses_allowed 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' ',expiration_date INT8 NOT NULL'
',gc_date INT8 NOT NULL' ',gc_date INT8 NOT NULL'
') %s ;' ') %s ;'
@ -82,7 +82,7 @@ BEGIN
); );
PERFORM comment_partitioned_column( 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' '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 ,table_name
,partition_suffix ,partition_suffix
); );

View File

@ -26,7 +26,7 @@ CREATE OR REPLACE FUNCTION exchange_do_batch_withdraw(
OUT reserve_found BOOLEAN, OUT reserve_found BOOLEAN,
OUT balance_ok BOOLEAN, OUT balance_ok BOOLEAN,
OUT age_ok BOOLEAN, OUT age_ok BOOLEAN,
OUT allowed_maximum_age INT4, -- in years OUT allowed_maximum_age INT2, -- in years
OUT ruuid INT8) OUT ruuid INT8)
LANGUAGE plpgsql LANGUAGE plpgsql
AS $$ AS $$
@ -74,7 +74,7 @@ END IF;
-- Check if age requirements are present -- Check if age requirements are present
IF ((NOT do_age_check) OR (reserve_birthday = 0)) IF ((NOT do_age_check) OR (reserve_birthday = 0))
THEN THEN
age_ok = OK; age_ok = TRUE;
allowed_maximum_age = -1; allowed_maximum_age = -1;
ELSE ELSE
-- Age requirements are formally not met: The exchange is setup to support -- Age requirements are formally not met: The exchange is setup to support

View File

@ -45,9 +45,9 @@ TEH_PG_do_batch_withdraw (
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
TALER_PQ_query_param_amount (amount), TALER_PQ_query_param_amount (amount),
GNUNET_PQ_query_param_auto_from_type (reserve_pub), 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 (&now),
GNUNET_PQ_query_param_timestamp (&gc), GNUNET_PQ_query_param_timestamp (&gc),
GNUNET_PQ_query_param_bool (do_age_check),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
@ -77,10 +77,10 @@ TEH_PG_do_batch_withdraw (
" reserve_found" " reserve_found"
",balance_ok" ",balance_ok"
",age_ok" ",age_ok"
",required_age" ",allowed_maximum_age"
",ruuid" ",ruuid"
" FROM exchange_do_batch_withdraw" " 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, return GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"call_batch_withdraw", "call_batch_withdraw",
params, params,