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: fix different err msg from MySQL when group by window function (#16134) #16427

Merged
merged 3 commits into from
Apr 26, 2020

Conversation

time-and-fate
Copy link
Member

cherry-pick #16134 to release-3.1


What problem does this PR solve?

Issue Number: close #11518

Problem Summary: When GROUP BY is followed by a number in a select stmt and this number correspond to a window function in select fields, TiDB prints a different error message from MySQL.

What is changed and how it works?

What's Changed: When dealing with ast.PositionExpr in gbyResolver's Leave() method, we check if it's a ast.WindowFuncExpr. If so, ErrWrongGroupField will occur, which is expected.

Check List

Tests

  • Unit test

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Apr 15, 2020
@time-and-fate
Copy link
Member Author

/run-unit-test

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 15, 2020
@zz-jason zz-jason requested a review from SunRunAway April 15, 2020 12:49
Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SunRunAway SunRunAway added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 26, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 26, 2020

Your auto merge job has been accepted, waiting for:

  • 16737

@sre-bot
Copy link
Contributor

sre-bot commented Apr 26, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Apr 26, 2020

@time-and-fate merge failed.

@SunRunAway
Copy link
Contributor

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Apr 26, 2020

/run-all-tests

@sre-bot sre-bot merged commit 63dd2e1 into pingcap:release-3.1 Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/compatibility type/3.1-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants