Re: BUG #18568: BUG: Result wrong when do group by on partition table!

From: jian he <jian(dot)universality(at)gmail(dot)com>
To: 狂奔的蜗牛 <1105066510(at)qq(dot)com>
Cc: Tender Wang <tndrwang(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, aleksander <aleksander(at)timescale(dot)com>
Subject: Re: BUG #18568: BUG: Result wrong when do group by on partition table!
Date: 2024-10-21 08:10:00
Message-ID: CACJufxGoV7aVjHwCC5VK3tQJULR45iA56UD6uGoLQQgEc6grQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Aug 8, 2024 at 7:21 PM 狂奔的蜗牛 <1105066510(at)qq(dot)com> wrote:
>
> Oh no!
> Sorry, I made a mistake on patch.
> v7 is new patch.

regress tests will fail for build with.
-Dicu=disabled

So I guess you have to put
src/test/regress/sql/partition_aggregate.sql related tests to
src/test/regress/sql/collate.icu.utf8.sql.

foreach(lc, partexprs)
{
ListCell *lg;
Expr *partexpr = lfirst(lc);
Oid partcoll =
input_rel->part_scheme->partcollation[cnt];
foreach (lg, groupexprs)
{
Expr *groupexpr = lfirst(lg);
Oid groupcoll = exprCollation((Node *) groupexpr);
/*
* GROUP BY xx COLLATE xxx
* Set collation in group by clause using COLLATE syntax,
* AND the collation IS NOT equal to column's default collation.
*/
if (IsA(groupexpr, RelabelType))
groupexpr = ((RelabelType *) groupexpr)->arg;

if (equal(groupexpr, partexpr) && partcoll == groupcoll)
{
found = true;
break;
}
}
if (found)
break;
}

/*
* GROUP BY xx COLLATE xxx
* Set collation in group by clause using COLLATE syntax,
* AND the collation IS NOT equal to column's default collation.
*/
i can understand the first part of the comment.
but here it is not related to column collation,
It's related to collation comparison between groupby expression and
partition key expressions.
so the second part of the comments confused me.

I added a commitfest entry in
https://commitfest.postgresql.org/50/5312/
you can put your name in the Authors field.

Other than that, it looks good to me.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexey Shishkin 2024-10-21 09:43:47 pg_ident.conf + regular expressions issue
Previous Message Heikki Linnakangas 2024-10-21 08:02:46 Re: BUG #18658: Assert in SerialAdd() due to race condition