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-00084u-M8@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
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4ec6581c0cdddfda767641f535116ee9a0412149

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


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix handling of init_plans list in inheritance_planner().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Update statement about sorting of character-string data.