public inbox for [email protected]
help / color / mirror / Atom feedFrom: Richard Guo <[email protected]>
To: Tom Lane <[email protected]>
Cc: Sergey Shinderuk <[email protected]>
Cc: [email protected]
Cc: David Rowley <[email protected]>
Subject: Re: BUG #19412: Wrong query result with not null constraint
Date: Fri, 20 Feb 2026 18:57:12 +0900
Message-ID: <CAMbWs4-Mv2jkyTj0VYNCVxVBJkr5NAzOsaDvAvFGe97B6eEStQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CAApHDvpXarz-D6tP-7y4ZrtnhXtdbRY0kQxRDQTVc3Z9DckYVw@mail.gmail.com>
<CAMbWs49kVgb_wS4VFuQpfZ+Re4tWVn7vmheR6HqKppnNuEaH-g@mail.gmail.com>
<CAMbWs49NVUNpQPwGb56SCSQL-bkjtxnkCb6Ot7dBxGndJoA3Pw@mail.gmail.com>
<[email protected]>
<CAMbWs481y0EmS7fFJE9DEjjHGJO4mh9nPmusPDQ77Psxgo96ww@mail.gmail.com>
<[email protected]>
On Fri, Feb 20, 2026 at 3:25 AM Tom Lane <[email protected]> wrote:
> I agree with this fix: I think the code is like it is simply because
> it didn't occur to me that the child Vars could have any nullingrel
> bits yet. However, I don't agree that that comment needs no updates.
> I suggest something like
>
> - * Below, we just propagate var->varnullingrels into the translated
> - * Var.
> + * Below, we just merge var->varnullingrels into the translated
> + * Var. (We must merge not just copy: the child Var could have
> + * some nullingrel bits set already, and we mustn't drop those.)
>
> Also, I think I'd then drop the comment you added adjacent to the
> actual update; it seems redundant if the earlier comment says this.
Thanks for taking a look. I've updated the comments as suggested,
> I agree with back-patching to v16. This particular example doesn't
> misbehave in versions that don't have the drop-allegedly-redundant-
> NOT-NULL-tests logic, but the varnullingrels are certainly wrong
> all the way back, so possibly there are other examples that do
> misbehave in v16.
... and then pushed and back-patched to v16.
Thank you, Sergey, for the report and the excellent self-contained
repro query. This is a great catch. (I'm curious how you found this
bug -- was it from a production query or a fuzzing tool?)
- Richard
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: BUG #19412: Wrong query result with not null constraint
In-Reply-To: <CAMbWs4-Mv2jkyTj0VYNCVxVBJkr5NAzOsaDvAvFGe97B6eEStQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox