pgsql: Fix miscomputation of direct_lateral_relids for join relations.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix miscomputation of direct_lateral_relids for join relations.
Дата
Msg-id E1kjmtS-0003rC-CZ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix miscomputation of direct_lateral_relids for join relations.

If a PlaceHolderVar is to be evaluated at a join relation, but
its value is only needed there and not at higher levels, we neglected
to update the joinrel's direct_lateral_relids to include the PHV's
source rel.  This causes problems because join_is_legal() then won't
allow joining the joinrel to the PHV's source rel at all, leading
to "failed to build any N-way joins" planner failures.

Per report from Andreas Seltenreich.  Back-patch to 9.5
where the problem originated.

Discussion: https://postgr.es/m/87blfgqa4t.fsf@aurora.ydns.eu

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b1738ff6ab73203cbbc02d7fb82941dbc061d301

Modified Files
--------------
src/backend/optimizer/util/placeholder.c | 38 +++++++++++++------
src/test/regress/expected/join.out       | 64 ++++++++++++++++++++++++++++++++
src/test/regress/sql/join.sql            | 27 ++++++++++++++
3 files changed, 118 insertions(+), 11 deletions(-)


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Refactor parsing rules for option lists of EXPLAIN, VACUUM and A
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Prevent parallel index build in a standalone backend.