From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix thinkos in have_unsafe_outer_join_ref; reduce to Assert chec
Date: Mon, 13 Feb 2023 16:45:45 +0000
Message-ID: <E1pRbxY-000xNu-B4@gemulon.postgresql.org> (raw)
Fix thinkos in have_unsafe_outer_join_ref; reduce to Assert check.
Late in the development of commit 2489d76c4, I (tgl) incorrectly
concluded that the new function have_unsafe_outer_join_ref couldn't
ever reach its inner loop. That should be the case if the inner
rel's parameterization is based on just one Var, but it could be
based on Vars from several relations, and then not only is the
inner loop reachable but it's wrongly coded.
Despite those errors, it still appears that the whole thing is
redundant given previous join_is_legal checks, so let's arrange
to only run it in assert-enabled builds.
Diagnosis and patch by Richard Guo, per fuzz testing by Justin Pryzby.
Discussion: https://postgr.es/m/20230212235823.GW1653@telsasoft.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f50f029c497da35927491f16964f7aa993ecbae5
Modified Files
--------------
src/backend/optimizer/path/joinpath.c | 29 ++++++++++++++---------------
src/test/regress/expected/join.out | 26 ++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 17 +++++++++++++++++
3 files changed, 57 insertions(+), 15 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Fix thinkos in have_unsafe_outer_join_ref; reduce to Assert chec
In-Reply-To: <E1pRbxY-000xNu-B4@gemulon.postgresql.org>
References: <E1pRbxY-000xNu-B4@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox