From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: marian.krucina@linuxbox.cz
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2
Date: Thu, 09 Nov 2023 15:51:01 -0500
Message-ID: <1246787.1699563061@sss.pgh.pa.us> (raw)
In-Reply-To: <CAMbWs4-zNHy3GAjiK7vnTEpU8eWiFRtHUB9s5mpo1Edhs=0Dfw@mail.gmail.com>
References: <18184-5868dd258782058e@postgresql.org>
<CAMbWs4-zNHy3GAjiK7vnTEpU8eWiFRtHUB9s5mpo1Edhs=0Dfw@mail.gmail.com>
Richard Guo <guofenglinux@gmail.com> writes:
> On Mon, Nov 6, 2023 at 10:39 PM PG Bug reporting form <
> noreply@postgresql.org> wrote:
>> ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2
> It seems that when we optimize field selection from a whole-row Var into
> a simple Var while simplifying functions, we fail to propagate the
> nullingrels into the new Var.
Yup, good catch! Fix pushed with a little editorializing on the test
case (mainly to try to ensure cross-platform stability of its plan).
> Attached is a hotfix for this error. But I'm wondering if there are
> other similar cases where we have mismatched nullingrels that we haven't
> discovered yet. Any thoughts?
It's worrisome I agree. I looked through the other calls of makeVar()
and didn't find any that seemed wrong. (There are a lot of them that
are concerned with cases like manufacturing rowmark Vars, which I
think are OK because we don't support FOR UPDATE on nullable rels.)
Still, I wouldn't be totally surprised if we find a few more.
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, guofenglinux@gmail.com, marian.krucina@linuxbox.cz, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2
In-Reply-To: <1246787.1699563061@sss.pgh.pa.us>
* 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