-misc fixes

This commit is contained in:
Christian Grothoff 2023-04-22 02:54:55 +02:00
parent be1d8afaec
commit 76b934b219
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -145,14 +145,12 @@ LANGUAGE plpgsql
AS $$ AS $$
DECLARE DECLARE
curs_reserve_exist REFCURSOR; curs_reserve_exist REFCURSOR;
DECLARE
k INT8;
DECLARE DECLARE
curs_transaction_exist REFCURSOR; curs_transaction_exist REFCURSOR;
DECLARE DECLARE
i RECORD; i RECORD;
DECLARE
r RECORD;
DECLARE
k INT8;
BEGIN BEGIN
transaction_duplicate0 = TRUE; transaction_duplicate0 = TRUE;
transaction_duplicate1 = TRUE; transaction_duplicate1 = TRUE;
@ -228,35 +226,33 @@ BEGIN
OPEN curs_transaction_exist FOR OPEN curs_transaction_exist FOR
WITH reserve_transaction AS ( WITH reserve_transaction AS (
INSERT INTO reserves_in INSERT INTO reserves_in
(reserve_pub (reserve_pub
,wire_reference ,wire_reference
,credit_val ,credit_val
,credit_frac ,credit_frac
,exchange_account_section ,exchange_account_section
,wire_source_h_payto ,wire_source_h_payto
,execution_date) ,execution_date)
VALUES VALUES
(in0_reserve_pub (in0_reserve_pub
,in0_wire_ref ,in0_wire_ref
,in0_credit_val ,in0_credit_val
,in0_credit_frac ,in0_credit_frac
,in0_exchange_account_name ,in0_exchange_account_name
,in0_wire_source_h_payto ,in0_wire_source_h_payto
,in0_execution_date), ,in0_execution_date),
(in1_reserve_pub (in1_reserve_pub
,in1_wire_ref ,in1_wire_ref
,in1_credit_val ,in1_credit_val
,in1_credit_frac ,in1_credit_frac
,in1_exchange_account_name ,in1_exchange_account_name
,in1_wire_source_h_payto ,in1_wire_source_h_payto
,in1_execution_date) ,in1_execution_date)
ON CONFLICT DO NOTHING ON CONFLICT DO NOTHING
RETURNING reserve_pub) RETURNING reserve_pub)
SELECT reserve_pub FROM reserve_transaction; SELECT reserve_pub FROM reserve_transaction;
FETCH FROM curs_transaction_exist INTO r;
k=0; k=0;
<<loop_transaction>> LOOP <<loop_transaction>> LOOP
FETCH FROM curs_transaction_exist INTO i; FETCH FROM curs_transaction_exist INTO i;