Re: BUG #18261: Inconsistent results of SELECT affected by joined subqueries

From: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, zuming(dot)jiang(at)inf(dot)ethz(dot)ch, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18261: Inconsistent results of SELECT affected by joined subqueries
Date: 2024-01-05 03:32:26
Message-ID: ee0d17cc-240a-44bf-acad-58790efb0153@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2/1/2024 15:02, Alexander Korotkov wrote:
> On Thu, Dec 28, 2023 at 6:32 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I'd say that that will break the cases rinfo_serial was introduced for.
>> Now, I certainly don't love rinfo_serial and would be happier if we
>> could do without it, but getting rid of it is another research project.
>
> It's a pity that no regression tests detect that. The attached patch
> implements the special comparison function, which ignores the
> 'rinfo_serial' field. This avoids marking 'rinfo_serial' as
> pg_node_attr(equal_ignore).
I've reviewed this patch, and it seems okay. It was a real blunder in
our understanding of clauses; thanks to all for pointing this out and
fixing it.
The regression test shows where two fully equal join clauses, applied on
different join levels, differ by the only required_relids. It covers the
problem and can be helpful by itself. IMO, one line in this test is
redundant (see attachment).
The comment on the patch looks okay. But assuming required_relids and
clause fields of two RestrinctInfos are equal, I can't imagine a
situation to have different is_pushed_down and incompatible_relids. Is
it really possible?

--
regards,
Andrei Lepikhov
Postgres Professional

Attachment Content-Type Size
tests_arrangement.diff text/plain 966 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-01-05 03:54:52 RE: BUG #18267: Logical replication bug: data is not synchronized after Alter Publication.
Previous Message Michael Paquier 2024-01-04 23:45:13 Re: BUG #18259: Assertion in ExtendBufferedRelLocal() fails after no-space-left condition