pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix bugs in plpgsql's handling of CALL argument lists.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix bugs in plpgsql's handling of CALL argument lists.
@ 2018-11-04 18:25  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-11-04 18:25 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bugs in plpgsql's handling of CALL argument lists.

exec_stmt_call() tried to extract information out of a CALL statement's
argument list without using expand_function_arguments(), apparently in
the hope of saving a few nanoseconds by not processing defaulted
arguments.  It got that quite wrong though, leading to crashes with
named arguments, as well as failure to enforce writability of the
argument for a defaulted INOUT parameter.  Fix and simplify the logic
by using expand_function_arguments() before examining the list.

Also, move the argument-examination to just after producing the CALL
command's plan, before invoking the called procedure.  This ensures
that we'll track possible changes in the procedure's argument list
correctly, and avoids a hazard of the plan cache being flushed while
the procedure executes.

Also fix assorted falsehoods and omissions in associated documentation.

Per bug #15477 from Alexey Stepanov.

Patch by me, with some help from Pavel Stehule.  Back-patch to v11.

Discussion: https://postgr.es/m/15477-86075b1d1d319e0a@postgresql.org
Discussion: https://postgr.es/m/CAFj8pRA6UsujpTs9Sdwmk-R6yQykPx46wgjj+YZ7zxm4onrDyw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15c7293477a6de03234f58898da7fb29f3ab5b94

Modified Files
--------------
doc/src/sgml/plpgsql.sgml                    |  34 ++++-
doc/src/sgml/ref/call.sgml                   |  11 +-
src/pl/plpgsql/src/expected/plpgsql_call.out |  82 ++++++++--
src/pl/plpgsql/src/pl_exec.c                 | 221 +++++++++++++++------------
src/pl/plpgsql/src/sql/plpgsql_call.sql      |  72 ++++++++-
5 files changed, 297 insertions(+), 123 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix bugs in plpgsql's handling of CALL argument lists.
@ 2018-11-04 18:25  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-11-04 18:25 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix bugs in plpgsql's handling of CALL argument lists.

exec_stmt_call() tried to extract information out of a CALL statement's
argument list without using expand_function_arguments(), apparently in
the hope of saving a few nanoseconds by not processing defaulted
arguments.  It got that quite wrong though, leading to crashes with
named arguments, as well as failure to enforce writability of the
argument for a defaulted INOUT parameter.  Fix and simplify the logic
by using expand_function_arguments() before examining the list.

Also, move the argument-examination to just after producing the CALL
command's plan, before invoking the called procedure.  This ensures
that we'll track possible changes in the procedure's argument list
correctly, and avoids a hazard of the plan cache being flushed while
the procedure executes.

Also fix assorted falsehoods and omissions in associated documentation.

Per bug #15477 from Alexey Stepanov.

Patch by me, with some help from Pavel Stehule.  Back-patch to v11.

Discussion: https://postgr.es/m/15477-86075b1d1d319e0a@postgresql.org
Discussion: https://postgr.es/m/CAFj8pRA6UsujpTs9Sdwmk-R6yQykPx46wgjj+YZ7zxm4onrDyw@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4b0c3712c530e3be92682099f56dbe0b08d802c2

Modified Files
--------------
doc/src/sgml/plpgsql.sgml                    |  34 ++++-
doc/src/sgml/ref/call.sgml                   |  11 +-
src/pl/plpgsql/src/expected/plpgsql_call.out |  82 ++++++++--
src/pl/plpgsql/src/pl_exec.c                 | 221 +++++++++++++++------------
src/pl/plpgsql/src/sql/plpgsql_call.sql      |  72 ++++++++-
5 files changed, 297 insertions(+), 123 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-11-04 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-04 18:25 pgsql: Fix bugs in plpgsql's handling of CALL argument lists. Tom Lane <tgl@sss.pgh.pa.us>
2018-11-04 18:25 pgsql: Fix bugs in plpgsql's handling of CALL argument lists. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox