Re: repeated procedure call error - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: repeated procedure call error
Date
Msg-id CAFj8pRBHQhz584Z-8qMJa4-2zmSMRDFJnoiD-tv474u1_15o7g@mail.gmail.com
Whole thread Raw
In response to repeated procedure call error  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: repeated procedure call error
List pgsql-hackers


pá 9. 11. 2018 v 20:05 odesílatel Pavel Stehule <pavel.stehule@gmail.com> napsal:
Hi

There are some broken. I tried to fix plpgsql_check regression tests and I found new error.

Looks it is fresh regression.

CREATE OR REPLACE PROCEDURE public.proc(a integer, INOUT b integer, c integer)
 LANGUAGE plpgsql
AS $procedure$
begin
  b := a + c + c;
end;
$procedure$

CREATE OR REPLACE PROCEDURE public.testproc()
 LANGUAGE plpgsql
AS $procedure$
declare r int;
begin
  call proc(10, r + 10, 20);
end;
$procedure$

postgres=# call testproc();
ERROR:  procedure parameter "b" is an output parameter but corresponding argument is not writable
CONTEXT:  PL/pgSQL function testproc() line 4 at CALL

first error message is correct,

Second call fails with unexpected error

ERROR:  SPI_execute_plan_with_paramlist failed executing query "CALL proc(10, r + 10, 20)": SPI_ERROR_ARGUMENT
CONTEXT:  PL/pgSQL function testproc() line 4 at CALL

Maybe plan cache is broken due exception?



regards

Pavel


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: repeated procedure call error
Next
From: Paul Ramsey
Date:
Subject: Re: Changing SQL Inlining Behaviour (or...?)