From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Fix bug with whole-row references to append subplans. |
Date: | 2014-07-11 23:13:30 |
Message-ID: | E1X5k0Q-0000Od-0i@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix bug with whole-row references to append subplans.
ExecEvalWholeRowVar incorrectly supposed that it could "bless" the source
TupleTableSlot just once per query. But if the input is coming from an
Append (or, perhaps, other cases?) more than one slot might be returned
over the query run. This led to "record type has not been registered"
errors when a composite datum was extracted from a non-blessed slot.
This bug has been there a long time; I guess it escaped notice because when
dealing with subqueries the planner tends to expand whole-row Vars into
RowExprs, which don't have the same problem. It is possible to trigger
the problem in all active branches, though, as illustrated by the added
regression test.
Branch
------
REL9_3_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/b77e6b959663f022c31167396f2b56275c792833
Modified Files
--------------
src/backend/executor/execQual.c | 33 ++++++++++++++++++-------------
src/test/regress/expected/subselect.out | 18 +++++++++++++++++
src/test/regress/sql/subselect.sql | 10 ++++++++++
3 files changed, 47 insertions(+), 14 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2014-07-12 12:23:14 | pgsql: Add autocompletion of locale keywords for CREATE DATABASE |
Previous Message | Peter Eisentraut | 2014-07-11 19:12:35 | pgsql: Fix whitespace |