diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-11-04 13:25:39 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-11-04 13:25:39 -0500 |
commit | 4b0c3712c530e3be92682099f56dbe0b08d802c2 (patch) | |
tree | 2e44586d8cf2f1e4ef667f6adb7b602b5b4e1cd5 /src/backend/commands/functioncmds.c | |
parent | 6f4e01c7d289ee39d08317f12ef979805bcbba00 (diff) | |
download | postgresql-4b0c3712c530e3be92682099f56dbe0b08d802c2.tar.gz postgresql-4b0c3712c530e3be92682099f56dbe0b08d802c2.zip |
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
Diffstat (limited to 'src/backend/commands/functioncmds.c')
0 files changed, 0 insertions, 0 deletions