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

planner: full-group checking cannot handle case sensitivity correctly #27723

Closed
qw4990 opened this issue Sep 1, 2021 · 3 comments
Closed

planner: full-group checking cannot handle case sensitivity correctly #27723

qw4990 opened this issue Sep 1, 2021 · 3 comments
Assignees
Labels
feature/developing the related feature is in development severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@qw4990
Copy link
Contributor

qw4990 commented Sep 1, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t (a varchar(12));
select substr(a, 12, 1) from t group by SUBSTR(a, 12, 1);

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

The query can be processed without any error.

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 'test.t.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                            |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0-alpha-793-gda7b00124
Edition: Community
Git Commit Hash: da7b00124b35dbe5cdb044224209857498879df5
Git Branch: master
UTC Build Time: 2021-09-01 07:19:56
GoVersion: go1.16.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@qw4990 qw4990 added type/bug The issue is confirmed as a bug. sig/planner SIG: Planner severity/moderate labels Sep 1, 2021
@zhangjinpeng87
Copy link
Contributor

Have we located the root cause?

@time-and-fate
Copy link
Member

Have we located the root cause?

It's because ExpressionDeepEqual doesn't implement comparing ExprNodes case-insensitively.

@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/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants