From a2095f7fb5a57ea1794f25d029756d9a140fd429 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 16 Feb 2011 19:24:45 -0500 Subject: 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/utils/adt/selfuncs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/selfuncs.c') diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index b3299b56d83..f10110b1b7e 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -4562,10 +4562,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; /* -- cgit v1.2.3