pgsql: Fix bogus test for hypothetical indexes in get_actual_variable_r

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix bogus test for hypothetical indexes in get_actual_variable_r
Date: 2011-02-17 00:25:06
Message-ID: E1PprgA-0006CE-VY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix bogus test for hypothetical indexes in get_actual_variable_range().

That function was supposing that indexoid == 0 for a hypothetical index,
but that is not likely to be true in any non-toy implementation of an index
adviser, since assigning a fake OID is the only way to know at EXPLAIN time
which hypothetical index got selected. Fix by adding a flag to
IndexOptInfo to mark hypothetical indexes. Back-patch to 9.0 where
get_actual_variable_range() was added.

Gurjeet Singh

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a2095f7fb5a57ea1794f25d029756d9a140fd429

Modified Files
--------------
src/backend/nodes/outfuncs.c | 2 ++
src/backend/optimizer/util/plancat.c | 1 +
src/backend/utils/adt/selfuncs.c | 4 ++--
src/include/nodes/relation.h | 3 ++-
4 files changed, 7 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-02-17 00:53:28 pgsql: Fix blatantly uninitialized variable in recent commit.
Previous Message Tom Lane 2011-02-16 22:25:00 pgsql: Add backwards-compatible declarations of some core GIN support f