pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix join removal logic to clean up sub-RestrictInfos of OR claus
2+ messages / 2 participants
[nested] [flat]

* pgsql: Fix join removal logic to clean up sub-RestrictInfos of OR claus
@ 2023-02-10 19:52  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2023-02-10 19:52 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix join removal logic to clean up sub-RestrictInfos of OR clauses.

analyzejoins.c took care to clean out removed relids from the
clause_relids and required_relids of RestrictInfos associated with
the doomed rel ... but it paid no attention to the fact that if such a
RestrictInfo contains an OR clause, there will be sub-RestrictInfos
containing similar fields.

I'm more than a bit surprised that this oversight hasn't caused
visible problems before.  In any case, it's certainly broken now,
so add logic to clean out the sub-RestrictInfos recursively.
We might need to back-patch this someday.

Per bug #17786 from Robins Tharakan.

Discussion: https://postgr.es/m/17786-f1ea7fbdab97daec@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/44e56baa80ff5fba150897308c8f25aa2251b16c

Modified Files
--------------
src/backend/optimizer/plan/analyzejoins.c | 77 +++++++++++++++++++++++++------
src/test/regress/expected/join.out        | 20 ++++++++
src/test/regress/sql/join.sql             |  8 ++++
3 files changed, 90 insertions(+), 15 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* [PATCH v1] Add test/modules to src/Makefile
@ 2025-08-19 13:58  Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Bertrand Drouvot @ 2025-08-19 13:58 UTC (permalink / raw)

meson does compile test/modules so let's be consistent in autoconf.
---
 src/Makefile | 1 +
 1 file changed, 1 insertion(+)
 100.0% src/

inline patch 1: src/Makefile (+1/-0 lines) download inline-1.patchdiff --git a/src/Makefile b/src/Makefile index 2f31a2f20a7..fd601c47039 100644 --- a/src/Makefile +++ b/src/Makefile @@ -27,6 +27,7 @@ SUBDIRS = \ bin \ pl \ makefiles \ + test/modules \ test/regress \ test/isolation \ test/perl -- 2.34.1
--PVEzLqnmlK9G50IV-- ^ permalink raw reply [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-08-19 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10 19:52 pgsql: Fix join removal logic to clean up sub-RestrictInfos of OR claus Tom Lane <tgl@sss.pgh.pa.us>
2025-08-19 13:58 [PATCH v1] Add test/modules to src/Makefile Bertrand Drouvot <bertranddrouvot.pg@gmail.com>

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