pgsql: Keep the planner from failing on "WHERE false AND something IN

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Keep the planner from failing on "WHERE false AND something IN
Дата
Msg-id 20071004204517.E3A7C753E4C@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Keep the planner from failing on "WHERE false AND something IN (SELECT ...)".
eval_const_expressions simplifies this to just "WHERE false", but we have
already done pull_up_IN_clauses so the IN join will be done, or at least
planned, anyway.  The trouble case comes when the sub-SELECT is itself a join
and we decide to implement the IN by unique-ifying the sub-SELECT outputs:
with no remaining reference to the output Vars in WHERE, we won't have
propagated the Vars up to the upper join point, leading to "variable not found
in subplan target lists" error.  Fix by adding an extra scan of in_info_list
and forcing all Vars mentioned therein to be propagated up to the IN join
point.  Per bug report from Miroslav Sulc.

Tags:
----
REL7_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        initsplan.c (r1.91.2.3 -> r1.91.2.4)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.91.2.3&r2=1.91.2.4)
        planmain.c (r1.78.4.1 -> r1.78.4.2)

(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planmain.c?r1=1.78.4.1&r2=1.78.4.2)
    pgsql/src/include/optimizer:
        planmain.h (r1.75.4.1 -> r1.75.4.2)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/planmain.h?r1=1.75.4.1&r2=1.75.4.2)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Keep the planner from failing on "WHERE false AND something IN
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Results from buildfarm show that ecpglib was depending on