pgsql: Fix handling of init_plans list in inheritance_planner().

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix handling of init_plans list in inheritance_planner().
Дата
Msg-id E1RrJVu-00084w-NS@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix handling of init_plans list in inheritance_planner().

Formerly we passed an empty list to each per-child-table invocation of
grouping_planner, and then merged the results into the global list.
However, that fails if there's a CTE attached to the statement, because
create_ctescan_plan uses the list to find the plan referenced by a CTE
reference; so it was unable to find any CTEs attached to the outer UPDATE
or DELETE.  But there's no real reason not to use the same list throughout
the process, and doing so is simpler and faster anyway.

Per report from Josh Berkus of "could not find plan for CTE" failures.
Back-patch to 9.1 where we added support for WITH attached to UPDATE or
DELETE.  Add some regression test cases, too.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1a096957d747a3bc93abe65722c919c8a40a1049

Modified Files
--------------
src/backend/optimizer/plan/planner.c |    3 +-
src/test/regress/expected/with.out   |   56 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/with.sql        |   30 ++++++++++++++++++
3 files changed, 87 insertions(+), 2 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Add simple tests of EvalPlanQual using the isolationtester infra
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix handling of init_plans list in inheritance_planner().