new only full group by should let select expression works
- 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)
```sql
set tidb_enable_new_only_full_group_by_check = 1;
create table t01(c_state varchar(20));
select substr(c_state, 1, 1) from t01 group by substr(c_state, 1, 1) order by substr(c_state, 1, 1);
```
### 2. What did you expect to see? (Required)
query success
### 3. What did you see instead (Required)
```sql
[15:18:35]TiDB root:test> select substr(c_state, 1, 1) from t01 group by substr(c_state, 1, 1) order by substr(c_state, 1, 1);
(1055, "Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t01.c_state' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by")
[15:18:35]TiDB root:test>
```
### 4. What is your TiDB version? (Required)
```sql
[15:19:11]TiDB root:test> select tidb_version();
+-----------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------+
| Release Version: v6.6.0 |
| Edition: Community |
| Git Commit Hash: a936e8e103c5cbe34115a082d68f18dc30475f40 |
| Git Branch: heads/refs/tags/v6.6.0 |
| UTC Build Time: 2023-02-12 07:57:11 |
| GoVersion: go1.19.5 |
| Race Enabled: false |
| TiKV Min Version: 6.2.0-alpha |
| Check Table Before Drop: false |
| Store: tikv |
+-----------------------------------------------------------+
1 row in set
```
Contributor guide
Assessment
This issue has not been assessed yet.