pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix broken MemoizePath support in reparameterize_path().
Date: Sun, 04 Dec 2022 18:48:35 +0000
Message-ID: <E1p1u2U-001zz6-BG@gemulon.postgresql.org> (raw)

Fix broken MemoizePath support in reparameterize_path().

It neglected to recurse to the subpath, meaning you'd get back
a path identical to the input.  This could produce wrong query
results if the omission meant that the subpath fails to enforce
some join clause it should be enforcing.  We don't have a test
case for this at the moment, but the code is obviously broken
and the fix is equally obvious.  Back-patch to v14 where
Memoize was introduced.

Richard Guo

Discussion: https://postgr.es/m/CAMbWs4_R=ORpz=Lkn2q3ebPC5EuWyfZF+tmfCPVLBVK5W39mHA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e76913802c5347831aadc1513b59196bde6ec116

Modified Files
--------------
src/backend/optimizer/util/pathnode.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1p1u2U-001zz6-BG@gemulon.postgresql.org>
Permalink:  ../E1p1u2U-001zz6-BG@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p1u2U-001zz6-BG@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 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 broken MemoizePath support in reparameterize_path().
  In-Reply-To: <E1p1u2U-001zz6-BG@gemulon.postgresql.org>
  References: <E1p1u2U-001zz6-BG@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