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

ranger: fix the range construction behavior when the column's type is YEAR #23559

Merged
merged 21 commits into from
Apr 14, 2021

Conversation

wjhuang2016
Copy link
Member

@wjhuang2016 wjhuang2016 commented Mar 25, 2021

Signed-off-by: wjhuang2016 [email protected]

What problem does this PR solve?

Issue Number: close #23508

Problem Summary:

The type of year should be int, not double.

What is changed and how it works?

Use ConvertToMysqlYear() to adjust the year constant, and handle some corner cases.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

  • Manual test (add detailed scripts or steps below)

Start a tidb cluster.
CREATE TABLE PK_S_MULTI_42_2 ( COL1 year(4) NOT NULL, COL2 year(4) NOT NULL, COL3 year(4) DEFAULT NULL, PRIMARY KEY (COL1,COL2) clustered);
mysql> select * from PK_S_MULTI_42_2 where col2 between 2154 and 2154 AND col3 > 2153;
Empty set (0.00 sec)

Side effects

Release note

  • fix wrong year type

Signed-off-by: wjhuang2016 <[email protected]>
Signed-off-by: wjhuang2016 <[email protected]>
@wjhuang2016 wjhuang2016 requested review from a team as code owners March 25, 2021 12:03
@wjhuang2016 wjhuang2016 requested review from lzmhhh123 and removed request for a team March 25, 2021 12:03
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 25, 2021
@ti-srebot
Copy link
Contributor

@wjhuang2016
Copy link
Member Author

/run-check_dev_2

@ichn-hu ichn-hu mentioned this pull request Mar 26, 2021
@lysu lysu requested a review from dyzsr March 26, 2021 08:21
@winoros winoros changed the title util: fix wrong year type ranger: fix the range construction behavior when the column's type is YEAR Mar 26, 2021
@dyzsr
Copy link
Contributor

dyzsr commented Mar 26, 2021

Can someone help me /lgtm?

@lzmhhh123 lzmhhh123 added the sig/execution SIG execution label Mar 26, 2021
util/ranger/points.go Show resolved Hide resolved
util/ranger/points.go Show resolved Hide resolved
Signed-off-by: wjhuang2016 <[email protected]>
@lysu
Copy link
Contributor

lysu commented Mar 30, 2021

do we need fix this in 5.0 GA? @wjhuang2016 @winoros - -

@wjhuang2016
Copy link
Member Author

do we need fix this in 5.0 GA? @wjhuang2016 @winoros - -

Sure , why not?

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 30, 2021
@lysu lysu added this to the v5.0.0 ga milestone Mar 30, 2021
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 3, 2021
@qw4990 qw4990 self-requested a review April 9, 2021 07:48
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

@wjhuang2016 Please resolve conflicts at your convenience. And should we add some new and separated test cases for this PR?

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • qw4990
  • winoros

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 12, 2021
@qw4990
Copy link
Contributor

qw4990 commented Apr 12, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: fca84b2

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 12, 2021
@wjhuang2016
Copy link
Member Author

/merge

@wjhuang2016
Copy link
Member Author

/merge

@wjhuang2016
Copy link
Member Author

/merge

@ti-chi-bot ti-chi-bot merged commit 670b5fb into pingcap:master Apr 14, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Apr 14, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #24018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression needs-cherry-pick-release-5.0 sig/execution SIG execution sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

“ Unexpected ExprType Float64 and EvalType Int” while using cluster index
8 participants