1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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
This commit is contained in:
Tom Lane
2011-02-16 19:24:45 -05:00
parent 6595dd04d1
commit a2095f7fb5
4 changed files with 7 additions and 3 deletions

View File

@ -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;
/*