-fix parameter in stored procedures
This commit is contained in:
parent
145310e20e
commit
f8536e8c14
@ -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
|
||||
);
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user