Skip to content

expression: fix compatibility of extract day_time unit functions#21601

Merged
ti-srebot merged 7 commits intopingcap:masterfrom
lzmhhh123:bug-fix/fix_extract_datetime
Dec 11, 2020
Merged

expression: fix compatibility of extract day_time unit functions#21601
ti-srebot merged 7 commits intopingcap:masterfrom
lzmhhh123:bug-fix/fix_extract_datetime

Conversation

@lzmhhh123
Copy link
Contributor

@lzmhhh123 lzmhhh123 commented Dec 9, 2020

Signed-off-by: lzmhhh123 lzmhhh123@gmail.com

What problem does this PR solve?

Issue Number: close #9716

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Side effects

  • Performance regression
    • Consumes more CPU

Release note

  • fix the compatibility of extract day_time unit functions

Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
@lzmhhh123 lzmhhh123 requested a review from a team as a code owner December 9, 2020 08:11
@lzmhhh123 lzmhhh123 requested review from wshwsh12 and removed request for a team December 9, 2020 08:11
@lzmhhh123
Copy link
Contributor Author

/cc @ichn-hu

@ti-srebot ti-srebot requested a review from ichn-hu December 9, 2020 08:12
@lzmhhh123
Copy link
Contributor Author

/cc @XuHuaiyu

@ti-srebot ti-srebot requested a review from XuHuaiyu December 9, 2020 08:12
Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
@lzmhhh123
Copy link
Contributor Author

./run-all-tests

Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
@lzmhhh123
Copy link
Contributor Author

/run-all-tests

@lzmhhh123
Copy link
Contributor Author

/rebuild
/run-common-test

@lzmhhh123
Copy link
Contributor Author

/run-all-tests

@lzmhhh123
Copy link
Contributor Author

/run-unit-test

@ichn-hu ichn-hu mentioned this pull request Dec 9, 2020
ichn-hu
ichn-hu previously approved these changes Dec 10, 2020
Copy link
Contributor

@ichn-hu ichn-hu 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 10, 2020
@XuHuaiyu XuHuaiyu added the type/bugfix This PR fixes a bug. label Dec 11, 2020
return int64(d.Hour())*10000 + int64(d.Minute())*100 + int64(d.Second()), nil
case "HOUR_MINUTE":
return int64(d.Hour())*100 + int64(d.Minute()), nil
case "DAY_MICROSECOND":
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some test in ExtractDurationNum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

select extract(day_second from "01 12:12:12") arrives here.

Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
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.

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 11, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 11, 2020
@lzmhhh123
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 11, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit f0c6fa9 into pingcap:master Dec 11, 2020
@lzmhhh123 lzmhhh123 deleted the bug-fix/fix_extract_datetime branch December 11, 2020 09:13
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 11, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/expression 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.

Function extract is incompatible with Mysql

4 participants