pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fixes for ChangeVarNodes_walker()
Date: Tue, 29 Apr 2025 11:34:55 +0000
Message-ID: <E1u9jEl-0009f5-31@gemulon.postgresql.org> (raw)

Fixes for ChangeVarNodes_walker()

This commit fixes two bug in ChangeVarNodes_walker() function.

 * When considering RestrictInfo, walk down to its clauses based on the
   presense of relid to be deleted not just in clause_relids but also in
   required_relids.

 * Incrementally adjust num_base_rels based on the change of clause_relids
   instead of recalculating it using clause_relids, which could contain
   outer-join relids.

Reported-by: Richard Guo <guofenglinux@gmail.com>
Discussion: https://postgr.es/m/CAMbWs49PE3CvnV8vrQ0Dr%3DHqgZZmX0tdNbzVNJxqc8yg-8kDQQ%40mail.gmail.com
Author: Andrei Lepikhov <lepihov@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2260c7f6d90ecf76d3806d32890a0890688b41e8

Modified Files
--------------
src/backend/rewrite/rewriteManip.c | 28 ++++++++++++++++++++++++----
src/test/regress/expected/join.out | 16 +++++++++++++++-
src/test/regress/sql/join.sql      |  8 +++++++-
3 files changed, 46 insertions(+), 6 deletions(-)



Message-ID: <E1u9jEl-0009f5-31@gemulon.postgresql.org>
Permalink:  ../E1u9jEl-0009f5-31@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u9jEl-0009f5-31@gemulon.postgresql.org

 · 

reply

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: Fixes for ChangeVarNodes_walker()
  In-Reply-To: <E1u9jEl-0009f5-31@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