From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix misuse of RelOptInfo.unique_for_rels cache by SJE
Date: Mon, 08 Jan 2024 22:09:21 +0000
Message-ID: <E1rMxo9-000WzQ-Va@gemulon.postgresql.org> (raw)
Fix misuse of RelOptInfo.unique_for_rels cache by SJE
When SJE uses RelOptInfo.unique_for_rels cache, it passes filtered quals to
innerrel_is_unique_ext(). That might lead to an invalid match to cache entries
made by previous non self-join checking calls. Add UniqueRelInfo.self_join
flag to prevent such cases. Also, fix that SJE should require a strict match
of outerrelids to make sure UniqueRelInfo.extra_clauses are valid.
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/4788f781-31bd-9796-d7d6-588a751c8787%40gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/30b4955a4668887044568743debef804b14418ca
Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 30 +++++++++++++++++++++---------
src/include/nodes/pathnodes.h | 6 ++++++
src/test/regress/expected/join.out | 23 +++++++++++++++++++++++
src/test/regress/sql/join.sql | 9 +++++++++
4 files changed, 59 insertions(+), 9 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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix misuse of RelOptInfo.unique_for_rels cache by SJE
In-Reply-To: <E1rMxo9-000WzQ-Va@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