Skip to content

[Bug]: mo report 'invalid argument cast to int, bad value All years' in rollup with grouping. #19998

@Ariznawlll

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

e7771f6

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

image

Expected Behavior

the same as mysql's behavior.

Steps to Reproduce

drop table if exists sales;
create table sales (
year int,
quarter int,
region text,
amount decimal(10, 2)
);

insert into sales (year, quarter, region, amount) values
(2021, 1, 'North', 10000),
(2021, 1, 'South', 15000),
(2021, 2, 'North', 20000),
(2021, 2, 'South', 25000),
(2022, 1, 'North', 30000),
(2022, 1, 'South', 35000),
(2022, 2, 'North', 40000),
(2022, 2, 'South', 45000);

select
    if(grouping(year), 'All years', year) AS year,
    if(grouping(quarter), 'Quarter', quarter) as quarter,
    region,
    sum(amount) as total_sales
from
    sales
group by
    year,
    quarter,
    region with rollup
order by total_sales desc;

Additional information

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions