Re: v17 Possible Union All Bug

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, Alexander Korotkov <akorotkov(at)postgresql(dot)org>, PostgreSQL Bug List <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Richard Guo <guofenglinux(at)gmail(dot)com>
Subject: Re: v17 Possible Union All Bug
Date: 2024-02-07 09:28:32
Message-ID: CAPpHfds3HKGo88b3f7Lz9yAKd29_N76cGDneVOgHDWgUCjXK4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Feb 4, 2024 at 6:57 AM Andrei Lepikhov
<a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
> The simple fix is in the attachment. But I'm not sure we should fix
> GROUP-BY optimization instead of the more general issue.
> The source of the problem is root->group_pathkeys, which contains
> grouping pathkeys and aggregate pathkeys. For now, their 'sortref'
> values could intersect, and we can differ which one references the query
> target list and which one the target list of the aggregate.
> So, I would like to get advice here: should we make a quick fix here, or
> is such a mess in the sortref values not a mess and designed for some
> purposes?

Thank you, Andrei. I think we should apply this fix for now, while
better refactoring could be done in future. I've revised your fix
with more comments and a commit message. I'm going to push it if
there are no objections.

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
0001-Fix-usage-of-aggregate-pathkeys-in-group_keys_reo-v1.patch application/octet-stream 5.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message just madhu 2024-02-07 09:47:06 pgjdbc is not working with PKCS8 certificates with password
Previous Message Peter Eisentraut 2024-02-07 07:49:17 Re: BUG #18336: Inconsistency in PostgreSQL 16 Documentation for SHOW Command