• Tom Lane's avatar
    Make executor's SELECT INTO code save and restore original tuple receiver. · dfd26f9c
    Tom Lane authored
    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.
    dfd26f9c
select_into.sql 1.72 KB