Skip site navigation (1) Skip section navigation (2)

pgsql: Make executor's SELECT INTO code save and restore originaltuple

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make executor's SELECT INTO code save and restore originaltuple
Date: 2012-01-04 23:31:48
Message-ID: E1RiaJA-0008Vq-9T@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Make executor's SELECT INTO code save and restore original tuple receiver.

As previously coded, the QueryDesc's dest pointer was left dangling
(pointing at an already-freed receiver object) after ExecutorEnd.  It's a
bit astonishing that it took us this long to notice, and I'm not sure that
the known problem case with SQL functions is the only one.  Fix it by
saving and restoring the original receiver pointer, which seems the most
bulletproof way of ensuring any related bugs are also covered.

Per bug #6379 from Paul Ramsey.  Back-patch to 8.4 where the current
handling of SELECT INTO was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/dfd26f9c5f371437f243249025863ea9911aacaa

Modified Files
--------------
src/backend/executor/execMain.c           |   20 +++++++++++++++-----
src/test/regress/expected/select_into.out |   25 +++++++++++++++++++++++++
src/test/regress/sql/select_into.sql      |   15 +++++++++++++++
3 files changed, 55 insertions(+), 5 deletions(-)

pgsql-committers by date

Next:From: Michael MeskesDate: 2012-01-05 13:10:18
Subject: pgsql: Ecpglib stores variables that are used in DECLARE statementsin
Previous:From: Michael MeskesDate: 2012-01-04 13:55:33
Subject: pgsql: Made code in ecpg better readable.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group