pingcap / pingcap/tidb

Unexpected error "Can't group on 'c0'"

Open
#58,974 0 comments 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
sig/planner type/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.