OSDN Git Service

Fix bogus test for hypothetical indexes in get_actual_variable_range().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Feb 2011 00:24:50 +0000 (19:24 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Feb 2011 00:24:50 +0000 (19:24 -0500)
commit7422e0081d04ee4373a822392c729eb892a9d25e
treef08f023bfd09fe44060d2d79b04014dcd6151455
parent8e4b1473126cc72fa9bcc5b079055c71bc267656
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
src/backend/nodes/outfuncs.c
src/backend/optimizer/util/plancat.c
src/backend/utils/adt/selfuncs.c
src/include/nodes/relation.h