pingcap / pingcap/tidb

Failed to check the ONLY_FULL_GROUP_BY (sometimes)

Open
#61,705 3 comments 0 reactions 0 assignees View on GitHub
severity/moderate 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)

1. Create a cloud cluster on TiDB cloud
2. Create a view
3. query view with group by stmt and missing a group by column in select list
```
select id, engineer_sales_activity_itr_id, recruit_id from recruit_recommends_view group by id, recruit_id;
```
Three key clue:
1. It happened sometimes not always
2. TiDB Cloud cluster
3. Before query , user send some ```SET SESSION collation_connection ```

### 2. What did you expect to see? (Required)

```
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'engineer_sales_activity_itr_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```

### 3. What did you see instead (Required)

Query is pass without any error

### 4. What is your TiDB version? (Required)

v8.1.1

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.