summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-02-16 19:24:50 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2011-02-16 19:24:50 -0500
commit7422e0081d04ee4373a822392c729eb892a9d25e (patch)
treef08f023bfd09fe44060d2d79b04014dcd6151455 /src/backend/utils/adt/selfuncs.c
parent8e4b1473126cc72fa9bcc5b079055c71bc267656 (diff)
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
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index c08310ba415..5c7e8325a19 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -4555,10 +4555,10 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
continue;
/*
- * The index list might include fictitious indexes inserted by a
+ * The index list might include hypothetical indexes inserted by a
* get_relation_info hook --- don't try to access them.
*/
- if (!OidIsValid(index->indexoid))
+ if (index->hypothetical)
continue;
/*