Fix ExecuteCallStmt to not scribble on the passed-in parse tree.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Nov 2018 19:50:55 +0000 (14:50 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 4 Nov 2018 19:50:55 +0000 (14:50 -0500)
commit9b6fb9fbb48dda828dcca47adc418632ddb36202
tree2d9a3c02251e927681327102a5b0a38e6d45444d
parent15c7293477a6de03234f58898da7fb29f3ab5b94
Fix ExecuteCallStmt to not scribble on the passed-in parse tree.

Modifying the parse tree at execution time is, or at least ought to be,
verboten.  It seems quite difficult to actually cause a crash this way
in v11 (although you can exhibit it pretty easily in HEAD by messing
with plan_cache_mode).  Nonetheless, it's risky, so fix and back-patch.

Discussion: https://postgr.es/m/13789.1541359611@sss.pgh.pa.us
src/backend/commands/functioncmds.c