pgsql: Fix incorrect generation of whole-row variables in planner.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix incorrect generation of whole-row variables in planner.
Date: 2010-10-19 19:11:22
Message-ID: E1P8Hak-0006S7-U0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix incorrect generation of whole-row variables in planner.

A couple of places in the planner need to generate whole-row Vars, and were
cutting corners by setting vartype = RECORDOID in the Vars, even in cases
where there's an identifiable named composite type for the RTE being
referenced. While we mostly got away with this, it failed when there was
also a parser-generated whole-row reference to the same RTE, because the
two Vars weren't equal() due to the difference in vartype. Fix by
providing a subroutine the planner can call to generate whole-row Vars
the same way the parser does.

Per bug #5716 from Andrew Tipton. Back-patch to 9.0 where one of the bogus
calls was introduced (the other one is new in HEAD).

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=6e74a91b2bf0e0032ccd60dd99d6cf47c190c428

Modified Files
--------------
src/backend/nodes/makefuncs.c | 87 ++++++++++++++++++++++++++++++++
src/backend/optimizer/prep/preptlist.c | 8 +--
src/backend/parser/parse_expr.c | 76 +---------------------------
src/backend/rewrite/rewriteHandler.c | 18 +++---
src/include/nodes/makefuncs.h | 4 ++
src/test/regress/expected/rowtypes.out | 38 ++++++++++++++
src/test/regress/sql/rowtypes.sql | 40 +++++++++++++++
7 files changed, 183 insertions(+), 88 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2010-10-19 21:38:37 pgsql: Restructure the pg_upgrade code to use several global structures
Previous Message Bruce Momjian 2010-10-19 15:58:10 pgsql: In pg_upgrade, rename SHELL_EXT to SCRIPT_EXT, for clarity.