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

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, zuming(dot)jiang(at)inf(dot)ethz(dot)ch, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18261: Inconsistent results of SELECT affected by joined subqueries
Date: 2024-01-08 15:40:02
Message-ID: CAPpHfdszEazFXUJXcDzPC=u9wWB__CnVGQKuaFr_8aY61yS4yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jan 8, 2024 at 3:10 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> On Mon, Jan 8, 2024 at 2:49 PM Alexander Korotkov <aekorotkov(at)gmail(dot)com> wrote:
> > On Mon, Jan 8, 2024, 13:51 Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> >> On Fri, Jan 5, 2024 at 11:32 AM Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
> >>>
> >>> 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).
> >>
> >>
> >> Hmm, I don't think the insert statement in the test case is redundant.
> >> It's needed to verify that the query in the test case gives the correct
> >> result. Without the insert statement, the wrong plan would give the
> >> same result as the correct plan, i.e., an empty set in this case.
> >>
> >> IMO, if we make some code changes and add a test case for that, we need
> >> to ensure the test can give a different (and correct of course) result
> >> than what came before.
> >
> > Thank you for pointing this. Yes, veryfying query result not just plan is strengthening the test. I'll recheck this and push the fix later today.
>
> Pushed. Thanks again, Richard.

I also noticed my indent oversight. Will fix that later today.

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=koel&dt=2024-01-08%2014%3A19%3A03

------
Regards,
Alexander Korotkov

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2024-01-08 16:37:14 Wrong datatype in docs for wal_summary_keep_time
Previous Message Andrey M. Borodin 2024-01-08 14:34:41 Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum