Re: BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: mtakahar(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18465: Wrong results from SELECT DISTINCT MIN in scalar subquery using HashAggregate
Date: 2024-05-18 16:56:44
Message-ID: 2787680.1716051404@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dmitry Dolgov <9erthalion6(at)gmail(dot)com> writes:
> Thanks, I could reproduce this in v15 and v16. Interestingly enough it
> was fixed in d0d44049d1, but looks like due to lack of error reports the
> fix was applied only on the main branch. I assume this one makes it
> necessary to back-patch the fix.

Hah. Nothing like fixing a bug that you know is there but you can't
demonstrate it ;-). I confirm the problem appears in d0d44049d1^
(and at least as far back as v12), but not in d0d44049d1 or HEAD.
So yeah, add test case and back-patch.

Many thanks for the test case!

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2024-05-18 22:23:11 Re: relfrozenxid may disagree with row XIDs after 1ccc1e05ae
Previous Message Tom Lane 2024-05-18 15:06:06 Re: BUG #18472: SELECT FOR UPDATE locking more rows than expected