You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
CREATE TABLE `t` (
`year` int(11) DEFAULT NULL,
`country` varchar(20) DEFAULT NULL,
`product` varchar(32) DEFAULT NULL,
`profit` int(11) DEFAULT NULL
)
alter table t set tiflash replica 1;
SELECT year+2 as y, sum(profit) as profit, grouping(year+2) FROM sales GROUP BY year+2, year+profit WITH ROLLUP having y > 2002 and profit >0 order by year+2, profit;
MySQL [test]> SELECT year+2 as y, SUM(profit) AS profit, grouping(year+2) FROM sales GROUP BY year+2, year+profit WITH ROLLUP having y > 2002 order by year+2, profit;
ERROR 3602 (HY000): Argument 3 of GROUPING function is not in GROUP BY
In plan building phase, grouping(year+2) is seen as not following the only-full-group-logic in pre-only-full-group-check logic.
Actually, we do have our own grouping function validation logic in expression rewriting function, just skip it there, and left it to expressionRewriter is enough.
4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered:
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
In plan building phase, grouping(year+2) is seen as not following the only-full-group-logic in pre-only-full-group-check logic.
Actually, we do have our own grouping function validation logic in expression rewriting function, just skip it there, and left it to
expressionRewriter
is enough.4. What is your TiDB version? (Required)
master
The text was updated successfully, but these errors were encountered: