Skip to content

[Bug] fix bug for grouping set query which where condition is false #14401 #14404

@qzsee

Description

@qzsee

Search before asking

  • I had searched in the issues and found no similar issues.

Version

all version

What's Wrong?

SQL:

table t : k1,k2,v(sum)

select k1,k2,sum(v) where k1 = 1 and 1 = 2 group by grouping sets((k1),(k1,k2))

ERROR 1105 (HY000): errCode = 2, detailMessage = failed to get tuple idx when prepare with tuple id: 1, slot id: 3

plan tree:
Agg
|
empty

EmptySetNode tupleIds should be composed of tuple(k1,k2) and VIRTUAL_TUPLE(Grouping_ID)

But in the current code,EmptySetNode tupleIds only contains tuple(k1,k2). So PartitionedAggregationNode init grouping_exprs_ lead to failed to get tuple idx when prepare with tuple id: 1, slot id: 3

What You Expected?

Correct interpretation

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions