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

SQL alias rule is different with mysql 5.7 #30841

Closed
SelbyLiu opened this issue Dec 17, 2021 · 3 comments · Fixed by #33567
Closed

SQL alias rule is different with mysql 5.7 #30841

SelbyLiu opened this issue Dec 17, 2021 · 3 comments · Fixed by #33567
Assignees
Labels
affects-5.2 This bug affects 5.2.x versions. affects-6.0 severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@SelbyLiu
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

image
image

in tidb 5.2.1 (linux)
when 'b' is table alias in from clause ,we use 'B' in group by clause and 'b' in order by clause, tidb popup error.
when 'b' is table alias in from clause ,we use 'B' in group by clause and 'B' in order by clause, sql is working.
in mysql 5.7.23(linux), sql is working in both situation, please help to check,thx.

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

when 'b' is table alias in from clause ,we use 'B' in group by clause and 'b' in order by clause, sql working as mysql.

3. What did you see instead (Required)

when 'b' is table alias in from clause ,we use 'B' in group by clause and 'b' in order by clause, tidb popup error.

4. What is your TiDB version? (Required)

5.2.1

middle_img_v2_c7ec5500-e0f6-4fff-a554-a26362f77feg

@SelbyLiu SelbyLiu added the type/bug The issue is confirmed as a bug. label Dec 17, 2021
@yudongusa
Copy link

@winoros this one seems a similar to alias issues we are currently investigating. Might be worthy to take this as refactor feature.

@jebter jebter added the affects-5.2 This bug affects 5.2.x versions. label Jan 11, 2022
@winoros
Copy link
Member

winoros commented Mar 21, 2022

@SelbyLiu Could you give us a clear example to show the problem?

@winoros
Copy link
Member

winoros commented Mar 23, 2022

This one has been solved via the new impl of the only_full_group_by checker.
It would be released in the next release version.
We downgrade its severity currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.2 This bug affects 5.2.x versions. affects-6.0 severity/minor sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants