Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dml: TiDB rejected valid select statement due to only_full_group_by while MySQL don't #25199

Closed
PragmaTwice opened this issue Jun 7, 2021 · 1 comment
Labels
feature/developing the related feature is in development severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@PragmaTwice
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table a(b integer);
SELECT c FROM(SELECT d c, d e FROM(SELECT 2 d FROM a) f) g GROUP BY e;

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

Empty set (0.00 sec)

only_full_group_by is also enabled in MySQL.

3. What did you see instead (Required)

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

Interestingly, the column name '.g.' in this message is also weird.

4. What is your TiDB version? (Required)

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                            |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.1.0-alpha-167-ga8ad9b7d3
Edition: Community
Git Commit Hash: a8ad9b7d3aa53d0181422d2b22fa8d57b7d56db1
Git Branch: master
UTC Build Time: 2021-06-05 07:04:28
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@PragmaTwice PragmaTwice added the type/bug The issue is confirmed as a bug. label Jun 7, 2021
@winoros winoros added severity/minor feature/developing the related feature is in development and removed severity/moderate labels Dec 15, 2021
@AilinKid
Copy link
Contributor

winoros#7 In our latest feature branch, this case has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/developing the related feature is in development severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

4 participants