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

Merged
merged 3 commits into from
Apr 8, 2020

Conversation

time-and-fate
Copy link
Member

@time-and-fate time-and-fate commented Apr 7, 2020

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

Release Note

  • Fix different err msg from MySQL when group by a window function.

@time-and-fate time-and-fate requested a review from a team as a code owner April 7, 2020 16:22
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Apr 7, 2020
@CLAassistant
Copy link

CLAassistant commented Apr 7, 2020

CLA assistant check)
All committers have signed the CLA.

@ghost ghost requested review from eurekaka and removed request for a team April 7, 2020 16:22
@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #16134 into master will not change coverage by %.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #16134   +/-   ##
===========================================
  Coverage   80.6129%   80.6129%           
===========================================
  Files           504        504           
  Lines        135936     135936           
===========================================
  Hits         109582     109582           
  Misses        17880      17880           
  Partials       8474       8474           

Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@eurekaka eurekaka added sig/planner SIG: Planner type/compatibility status/LGT1 Indicates that a PR has LGTM 1. labels Apr 8, 2020
Copy link
Contributor

@lzmhhh123 lzmhhh123 left a comment

Choose a reason for hiding this comment

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

LGTM

@lzmhhh123 lzmhhh123 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 8, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

@time-and-fate merge failed.

@lzmhhh123
Copy link
Contributor

/merge

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

/run-all-tests

@sre-bot sre-bot merged commit bdbc254 into pingcap:master Apr 8, 2020
@SunRunAway
Copy link
Contributor

/run-cherry-picker

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-3.0 in PR #16161

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-3.1 in PR #16162

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-4.0 in PR #16165

@sre-bot
Copy link
Contributor

sre-bot commented May 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. sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different error message from MySQL when select a window function with group by
6 participants