pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO
2+ messages / 1 participants
[nested] [flat]

* pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO
@ 2015-08-15 16:01 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-08-15 16:01 UTC (permalink / raw)
  To: pgsql-committers

Repair unsafe use of shared typecast-lookup table in plpgsql DO blocks.

DO blocks use private simple_eval_estates to avoid intra-transaction memory
leakage, cf commit c7b849a89.  I had forgotten about that while writing
commit 0fc94a5ba, but it means that expression execution trees created
within a DO block disappear immediately on exiting the DO block, and hence
can't safely be linked into plpgsql's session-wide cast hash table.
To fix, give a DO block a private cast hash table to go with its private
simple_eval_estate.  This is less efficient than one could wish, since
DO blocks can no longer share any cast lookup work with other plpgsql
execution, but it shouldn't be too bad; in any case it's no worse than
what happened in DO blocks before commit 0fc94a5ba.

Per bug #13571 from Feike Steenbergen.  Preliminary analysis by
Oleksandr Shulgin.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/83604cc42353b6c0de2a3f3ac31f94759a9326ae

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c          |   79 +++++++++++++++++++++------------
src/pl/plpgsql/src/plpgsql.h          |    4 ++
src/test/regress/expected/plpgsql.out |    7 +++
src/test/regress/sql/plpgsql.sql      |    9 ++++
4 files changed, 71 insertions(+), 28 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO
@ 2015-08-15 16:01 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-08-15 16:01 UTC (permalink / raw)
  To: pgsql-committers

Repair unsafe use of shared typecast-lookup table in plpgsql DO blocks.

DO blocks use private simple_eval_estates to avoid intra-transaction memory
leakage, cf commit c7b849a89.  I had forgotten about that while writing
commit 0fc94a5ba, but it means that expression execution trees created
within a DO block disappear immediately on exiting the DO block, and hence
can't safely be linked into plpgsql's session-wide cast hash table.
To fix, give a DO block a private cast hash table to go with its private
simple_eval_estate.  This is less efficient than one could wish, since
DO blocks can no longer share any cast lookup work with other plpgsql
execution, but it shouldn't be too bad; in any case it's no worse than
what happened in DO blocks before commit 0fc94a5ba.

Per bug #13571 from Feike Steenbergen.  Preliminary analysis by
Oleksandr Shulgin.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1f6a7eba466d0cb31cd2f374603799935fcb9df8

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c          |   79 +++++++++++++++++++++------------
src/pl/plpgsql/src/plpgsql.h          |    4 ++
src/test/regress/expected/plpgsql.out |    7 +++
src/test/regress/sql/plpgsql.sql      |    9 ++++
4 files changed, 71 insertions(+), 28 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2015-08-15 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-15 16:01 pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO Tom Lane <tgl@sss.pgh.pa.us>
2015-08-15 16:01 pgsql: Repair unsafe use of shared typecast-lookup table in plpgsql DO 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