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

expression: prevent function of castYearAsTime from pushing down to Ti… (#25975) #26370

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jul 20, 2021

cherry-pick #25975 to release-5.1
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/26370

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/tidb.git pr/26370:release-5.1-39a56e5c4df0

What problem does this PR solve?

Issue Number: pingcap/tiflash#1964

Problem Summary:

The type of year operation with the type of date is wrong, for example:

create table t(a year,b date);
insert into t values(2005,"2004-10-10"),(2015,"2018-03-27");
alter table t set tiflash replica 1;
select * from t where a>b;

except:

+------+------------+
| a    | b          |
+------+------------+
| 2005 | 2004-10-10 |
+------+------------+

actual:

empty

What is changed and how it works?

the problem is because that the column a of type year handled by function of castIntAsTime is pushed down to Tiflash.
Tiflash cannot recognize type year without field type, so cast the column a as time incorrectly.
Temporarily stop pushing down the function of castIntAsTime to TiFlash to get the correctly record.

Release note

  • no release note

@ti-srebot ti-srebot requested a review from a team as a code owner July 20, 2021 06:47
@ti-srebot ti-srebot requested review from lzmhhh123 and removed request for a team July 20, 2021 06:47
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@mengxin9014 please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tidb/invitations

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

/lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 20, 2021
@zhouqiang-cl zhouqiang-cl added the cherry-pick-approved Cherry pick PR approved by release team. label Jul 20, 2021
Copy link
Contributor

@LittleFall LittleFall left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • LittleFall

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@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 Jul 20, 2021
@LittleFall
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 5f42ce3

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 20, 2021
@ti-chi-bot ti-chi-bot merged commit 8f54e03 into pingcap:release-5.1 Jul 20, 2021
@zhouqiang-cl zhouqiang-cl added this to the v5.1.1 milestone Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. component/expression size/XS Denotes a PR that changes 0-9 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/5.1-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants