Re: BUG #18568: BUG: Result wrong when do group by on partition table! - Mailing list pgsql-bugs

From jian he
Subject Re: BUG #18568: BUG: Result wrong when do group by on partition table!
Date
Msg-id CACJufxGoV7aVjHwCC5VK3tQJULR45iA56UD6uGoLQQgEc6grQw@mail.gmail.com
Whole thread Raw
In response to 回复: BUG #18568: BUG: Result wrong when do group by on partition table!  ("狂奔的蜗牛" <1105066510@qq.com>)
Responses Re: BUG #18568: BUG: Result wrong when do group by on partition table!
List pgsql-bugs
On Thu, Aug 8, 2024 at 7:21 PM 狂奔的蜗牛 <1105066510@qq.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.



pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #18658: Assert in SerialAdd() due to race condition
Next
From: PG Bug reporting form
Date:
Subject: BUG #18666: Standby cluster does not start after building from Primary cluster.