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, types: fix datetime and year comparison error #20233

Merged
merged 17 commits into from
Dec 18, 2020

Conversation

3AceShowHand
Copy link
Contributor

@3AceShowHand 3AceShowHand commented Sep 26, 2020

What problem does this PR solve?

Issue Number: close #20121

Problem Summary:

What is changed and how it works?

For Datetime vs Year, Date vs Year, Timestamp vs Year comparison, CompareTime should be used, and Year should be converted to Time before comparing.

What's Changed:

expression/builtin_cast.go
types/time.go

How it Works:

For Datetime vs Year, Date vs Year, Timestamp vs Year comparison, CompareTime should be used, and Year should be converted to Time before comparing.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

  • No release note

@3AceShowHand 3AceShowHand requested a review from a team as a code owner September 26, 2020 18:25
@3AceShowHand 3AceShowHand requested review from lzmhhh123 and removed request for a team September 26, 2020 18:25
@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Sep 26, 2020
@CLAassistant
Copy link

CLAassistant commented Sep 26, 2020

CLA assistant check
All committers have signed the CLA.

@sre-bot
Copy link
Contributor

sre-bot commented Sep 26, 2020

@3AceShowHand
Copy link
Contributor Author

/rebuild

@qw4990 qw4990 self-requested a review September 27, 2020 03:23
@XuHuaiyu XuHuaiyu added the type/bugfix This PR fixes a bug. label Sep 27, 2020
@3AceShowHand
Copy link
Contributor Author

/rebuild

@crazycs520
Copy link
Contributor

/run-unit-test

@3AceShowHand
Copy link
Contributor Author

/rebuild

1 similar comment
@3AceShowHand
Copy link
Contributor Author

/rebuild

@3AceShowHand
Copy link
Contributor Author

/run-unit-test

Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

rest LGTM

expression/builtin_compare.go Outdated Show resolved Hide resolved
@XuHuaiyu XuHuaiyu changed the title expression: fix issue20121, datetime and year comparison error expression, types: fix datetime and year comparison error Sep 28, 2020
@3AceShowHand
Copy link
Contributor Author

/run-integration-copr-test tikv=pr/9287

@zhongzc
Copy link
Contributor

zhongzc commented Dec 17, 2020

/run-integration-copr-test tikv=pr/9287

@breezewish
Copy link
Member

/run-all-tests tikv=pr/9287

1 similar comment
@3AceShowHand
Copy link
Contributor Author

/run-all-tests tikv=pr/9287

@breezewish
Copy link
Member

/run-integration-common-test tikv=pr/9287

@breezewish
Copy link
Member

/run-integration-copr-test tikv=pr/9287

@breezewish
Copy link
Member

/run-integration-copr-test tikv=pr/9287

1 similar comment
@breezewish
Copy link
Member

/run-integration-copr-test tikv=pr/9287

@breezewish
Copy link
Member

/run-integration-copr-test tikv=pr/9287

1 similar comment
@breezewish
Copy link
Member

/run-integration-copr-test tikv=pr/9287

@breezewish
Copy link
Member

/run-all-tests tikv=pr/9287

@XuHuaiyu XuHuaiyu merged commit b232a23 into pingcap:master Dec 18, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 18, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #21880

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 18, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21881

ti-chi-bot pushed a commit to tikv/tikv that referenced this pull request Jan 27, 2021
cherry-pick #9287 to release-4.0

---

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

### What problem does this PR solve?

Issue Number: pingcap/tidb#20121

### What is changed and how it works?

Add `cast_year_as_time`

### Related changes

- pingcap/tidb#20233

### Check List <!--REMOVE the items that are not applicable-->

Tests <!-- At least one of them must be included. -->

- Unit test
- Integration test

### Release note
- Add `cast_year_as_time`
ti-srebot added a commit that referenced this pull request Jan 27, 2021
gengliqi pushed a commit to gengliqi/tikv that referenced this pull request Feb 20, 2021
cherry-pick tikv#9287 to release-4.0

---

Signed-off-by: Zhenchi <zhongzc_arch@outlook.com>

### What problem does this PR solve?

Issue Number: pingcap/tidb#20121

### What is changed and how it works?

Add `cast_year_as_time`

### Related changes

- pingcap/tidb#20233

### Check List <!--REMOVE the items that are not applicable-->

Tests <!-- At least one of them must be included. -->

- Unit test
- Integration test

### Release note
- Add `cast_year_as_time`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression 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/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datetime and year comparison error