Fix thinko in plpgsql memory leak fix.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ea80d8d9437e80de6506dbfe3765d834653312bf
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-12-28T16:41:25Z
Releases: 14.0
Fix thinko in plpgsql memory leak fix.

Commit a6b1f5365 intended to place the transient "target" list of
a CALL statement in the function's statement-lifespan context,
but I fat-fingered that and used get_eval_mcontext() instead of
get_stmt_mcontext().  The eval_mcontext belongs to the "simple
expression" infrastructure, which is destroyed at transaction end.
The net effect is that a CALL in a procedure to another procedure
that has OUT or INOUT parameters would fail if the called procedure
did a COMMIT.

Per report from Peter Eisentraut.  Back-patch to v11, like the
prior patch.

Discussion: https://postgr.es/m/f075f7be-c654-9aa8-3ffc-e9214622f02a@enterprisedb.com

Files

Discussion