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

pgsql: Fix potential failure when hashing the output of a subplan that

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix potential failure when hashing the output of a subplan that
Date: 2010-07-28 04:51:08
Message-ID: 20100728045108.94F9D7541D5@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix potential failure when hashing the output of a subplan that produces
a pass-by-reference datatype with a nontrivial projection step.
We were using the same memory context for the projection operation as for
the temporary context used by the hashtable routines in execGrouping.c.
However, the hashtable routines feel free to reset their temp context at
any time, which'd lead to destroying input data that was still needed.
Report and diagnosis by Tao Ma.

Back-patch to 8.1, where the problem was introduced by the changes that
allowed us to work with "virtual" tuples instead of materializing intermediate
tuple values everywhere.  The earlier code looks quite similar, but it doesn't
suffer the problem because the data gets copied into another context as a
result of having to materialize ExecProject's output tuple.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/executor:
        nodeSubplan.c (r1.99 -> r1.99.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/nodeSubplan.c?r1=1.99&r2=1.99.2.1)
    pgsql/src/include/nodes:
        execnodes.h (r1.205.2.2 -> r1.205.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/execnodes.h?r1=1.205.2.2&r2=1.205.2.3)
    pgsql/src/test/regress/expected:
        subselect.out (r1.22.2.2 -> r1.22.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/subselect.out?r1=1.22.2.2&r2=1.22.2.3)
    pgsql/src/test/regress/sql:
        subselect.sql (r1.14.2.2 -> r1.14.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/subselect.sql?r1=1.14.2.2&r2=1.14.2.3)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-07-28 04:51:15
Subject: pgsql: Fix potential failure when hashing the output of a subplan that
Previous:From: Tom LaneDate: 2010-07-28 04:50:59
Subject: pgsql: Fix potential failure when hashing the output of a subplan that

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