Unexpected error "Can't group on 'c0'"
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
The following test case triggers an error on latest version of TiDB
```
CREATE TABLE t1(c0 CHAR DEFAULT '');
INSERT INTO t1 VALUES ('');
SELECT AVG(t1.c0) FROM t1 GROUP BY t1.c0, true;
```
This is the error message: `Can't group on 'c0'`
I run this test case in MySQL 8.0 and 9.0, both of them run successfully.
### 2. What did you expect to see? (Required)
Not any error message.
### 3. What did you see instead (Required)
`Can't group on 'c0'`
### 4. What is your TiDB version? (Required)
Server version: 8.0.11-TiDB-v7.5.1 TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible
Contributor guide
Assessment
This issue has not been assessed yet.