]> granicus.if.org Git - postgresql/commit
Make executor's SELECT INTO code save and restore original tuple receiver.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Jan 2012 23:31:08 +0000 (18:31 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Jan 2012 23:31:08 +0000 (18:31 -0500)
commitc024a3b3be1c86459f9b47f81f61cb8a67ee2712
treec408dfca4b1488198b9bad32995905f289a8cffb
parent7443ab2b348d190e8784a2684a5b6ae91f7dcd4b
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.
src/backend/executor/execMain.c
src/test/regress/expected/select_into.out
src/test/regress/sql/select_into.sql