pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix thinko in plpgsql memory leak fix.
Date: Mon, 28 Dec 2020 16:41:39 +0000
Message-ID: <E1ktvaV-00030N-FH@gemulon.postgresql.org> (raw)

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2e15f48d97271ce4ee6707f172494a1ebd0bc8e2

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_call.out | 21 +++++++++++++++++++++
src/pl/plpgsql/src/pl_exec.c                 |  4 ++--
src/pl/plpgsql/src/sql/plpgsql_call.sql      | 24 ++++++++++++++++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1ktvaV-00030N-FH@gemulon.postgresql.org>
Permalink:  ../E1ktvaV-00030N-FH@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ktvaV-00030N-FH@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix thinko in plpgsql memory leak fix.
  In-Reply-To: <E1ktvaV-00030N-FH@gemulon.postgresql.org>
  References: <E1ktvaV-00030N-FH@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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