From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix miscomputation of direct_lateral_relids for join relations. |
Date: | 2020-11-30 17:23:18 |
Message-ID: | E1kjmtS-0003rF-DZ@gemulon.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | 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
------
REL_12_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/4f728a1f5f06dab85f6b94fd062752a25239c6b6
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-11-30 19:38:14 | pgsql: Prevent parallel index build in a standalone backend. |
Previous Message | Michael Paquier | 2020-11-30 11:29:17 | pgsql: Refactor parsing rules for option lists of EXPLAIN, VACUUM and A |