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

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

I agree with advice of code style, and I have trim&nbsp;trailing whitespace in V6 patch.

About test case added in file partition_aggregate.sql, for we create case_insentitive collation based on ICU, which regress sql file we should write is better ?
If write into collate.icu.utf8.sql, it seems not&nbsp;suitable.

狂奔的蜗牛
1105066510(at)qq(dot)com

&nbsp;

------------------&nbsp;原始邮件&nbsp;------------------
发件人: "Tender Wang" <tndrwang(at)gmail(dot)com&gt;;
发送时间:&nbsp;2024年8月8日(星期四) 下午4:20
收件人:&nbsp;"jian he"<jian(dot)universality(at)gmail(dot)com&gt;;
抄送:&nbsp;"狂奔的蜗牛"<1105066510(at)qq(dot)com&gt;;"pgsql-bugs"<pgsql-bugs(at)lists(dot)postgresql(dot)org&gt;;"aleksander"<aleksander(at)timescale(dot)com&gt;;
主题:&nbsp;Re: BUG #18568: BUG: Result wrong when do group by on partition table!

jian he <jian(dot)universality(at)gmail(dot)com&gt; 于2024年8月8日周四 15:51写道:

On Wed, Aug 7, 2024 at 11:04 PM jian he <jian(dot)universality(at)gmail(dot)com&gt; wrote:
&gt;
&gt; On Wed, Aug 7, 2024 at 9:08 PM 狂奔的蜗牛 <1105066510(at)qq(dot)com&gt; wrote:
&gt; &gt;
&gt; &gt; I readd RelabelType to branch in v5 patch, and add case to cover the code.
&gt; &gt;


I did some minor adjustments in group_by_has_partkey, also refactored
the comment.

The logic in patch I think no problem. But I don't like the code style.

if (IsA(groupexpr, RelabelType))
&nbsp; &nbsp; &nbsp;groupexpr = ((RelabelType *) groupexpr)-&gt;arg;

if (expr(groupexpr, partexr) &amp;&amp; partcoll == groupcoll)
{
...
}

This looks more compact.

By the way, I think we'd better to include test cases together in your patch, then others can continue
to work based on your patch not need to go back to add the test cases.

--
Tender Wang

Attachment Content-Type Size
v6-0001-fix-group_by_has_partkey-bug-and-add-regress-test.patch application/octet-stream 8.8 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2024-08-08 09:29:53 Re: BUG #18575: Sometimes pg_rewind mistakenly assumes that nothing needs to be done.
Previous Message Aleš Zelený 2024-08-08 08:31:38 Re: BUG #18573: Analyze command consumes several GB of memory - more than analyzed table size