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 EXPLAIN of SEARCH BREADTH FIRST queries some more.
Date: Mon, 11 Oct 2021 15:57:06 +0000
Message-ID: <E1mZxfm-0002o8-8P@gemulon.postgresql.org> (raw)

Fix EXPLAIN of SEARCH BREADTH FIRST queries some more.

Commit 3f50b8263 had an oversight: formerly, to deparse expressions
attached to a plan node, it was only necessary to update the
deparse_namespace ancestors list alongside calling set_deparse_plan.
Now it's necessary to update the ancestors list *first*, because
set_deparse_plan consults it, and one call site got that wrong.

This error was masked in most cases because explain.c uses just one
List object for the ancestors list, updating it in-place as the plan
is scanned, so that we accidentally had the right List assigned to
dpns->ancestors before it was needed.  It would fail only if a
WorkTableScan node were the first one that we tried to deparse a
subexpression of.

Per report from Markus Winand.  Like the previous patch,
back-patch to v14.

Discussion: https://postgr.es/m/648B0505-AA57-42C2-A2DA-E551DE46FA15@winand.at

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/39ae0ef8561362304ee512963aa51d5a705e5616

Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1mZxfm-0002o8-8P@gemulon.postgresql.org>
Permalink:  ../E1mZxfm-0002o8-8P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mZxfm-0002o8-8P@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 EXPLAIN of SEARCH BREADTH FIRST queries some more.
  In-Reply-To: <E1mZxfm-0002o8-8P@gemulon.postgresql.org>
  References: <E1mZxfm-0002o8-8P@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