From: Etsuro Fujita <efujita@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix rescanning of async-aware Append nodes.
Date: Mon, 07 Jun 2021 03:54:26 +0000
Message-ID: <E1lq6LK-0005nm-NL@gemulon.postgresql.org> (raw)
Fix rescanning of async-aware Append nodes.
In cases where run-time pruning isn't required, the synchronous and
asynchronous subplans for an async-aware Append node determined using
classify_matching_subplans() should be re-used when rescanning the node,
but the previous code re-determined them using that function repeatedly
each time when rescanning the node, leading to incorrect results in a
normal build and an Assert failure in an Assert-enabled build as that
function doesn't assume that it's called repeatedly in such cases. Fix
the code as mentioned above.
My oversight in commit 27e1f1456.
While at it, initialize async-related pointers/variables to NULL/zero
explicitly in ExecInitAppend() and ExecReScanAppend(), just to be sure.
(The variables would have been set to zero before we get to the latter
function, but let's do so.)
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/CAPmGK16Q4B2_KY%2BJH7rb7wQbw54AUprp7TMekGTd2T1B62yysQ%40mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f3baaf28a6da588987b94a05a725894805c3eae9
Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 42 ++++++++++++++++++++++++++
contrib/postgres_fdw/sql/postgres_fdw.sql | 12 ++++++++
src/backend/executor/nodeAppend.c | 27 ++++++++++++++---
3 files changed, 76 insertions(+), 5 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 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: efujita@postgresql.org
Subject: Re: pgsql: Fix rescanning of async-aware Append nodes.
In-Reply-To: <E1lq6LK-0005nm-NL@gemulon.postgresql.org>
References: <E1lq6LK-0005nm-NL@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