pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix thinko in plpgsql memory leak fix.
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix thinko in plpgsql memory leak fix.
@ 2020-12-28 16:41 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2020-12-28 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ea80d8d9437e80de6506dbfe3765d834653312bf

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(-)



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

* pgsql: Fix thinko in plpgsql memory leak fix.
@ 2020-12-28 16:41 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2020-12-28 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0ea25ed108d8344ac17012e62790e7e9ef7f1a7a

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(-)



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

* pgsql: Fix thinko in plpgsql memory leak fix.
@ 2020-12-28 16:41 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2020-12-28 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fd1347f9d8def3a892a7335ec026bff0227db1af

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(-)



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

* pgsql: Fix thinko in plpgsql memory leak fix.
@ 2020-12-28 16:41 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2020-12-28 16:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



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


end of thread, other threads:[~2020-12-28 16:41 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28 16:41 pgsql: Fix thinko in plpgsql memory leak fix. Tom Lane <tgl@sss.pgh.pa.us>
2020-12-28 16:41 pgsql: Fix thinko in plpgsql memory leak fix. Tom Lane <tgl@sss.pgh.pa.us>
2020-12-28 16:41 pgsql: Fix thinko in plpgsql memory leak fix. Tom Lane <tgl@sss.pgh.pa.us>
2020-12-28 16:41 pgsql: Fix thinko in plpgsql memory leak fix. 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