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

Add unittests for str_to_date, fix #3556, #3557 #3581

Merged
merged 13 commits into from
Dec 14, 2021

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Dec 2, 2021

What problem does this PR solve?

Issue Number: close #3557

close #3556

Problem Summary:

What is changed and how it works?

Check List

Tests

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

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fix the bug that function `STR_TO_DATE()` incorrectly handles leading zeros when parsing microseconds

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Dec 2, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • fuzhe1989

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 release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 2, 2021
@wshwsh12 wshwsh12 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2021
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2021
{"10/1/2010", "%d/%c/%Y", MyDateTime{2010, 1, 10, 0, 0, 0, 0}},
{"10/01/2010", "%d/%c/%Y", MyDateTime{2010, 1, 10, 0, 0, 0, 0}},
{"10/001/2010", "%d/%c/%Y", std::nullopt},
{"10/13/2010", "%d/%c/%Y", std::nullopt},
Copy link
Contributor

Choose a reason for hiding this comment

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

This may allow under sql_mode with ALLOW_INVALID_DATES
https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html#sqlmode_allow_invalid_dates
TiDB: pingcap/tidb#8263

Should we open an issue for ALLOW_INVALID_DATES in TiFlash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In mysql's ALLOW_INVALID_DATES mode, this case also gets NULL.

Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

@wshwsh12 wshwsh12 changed the title Add unittests for str_to_date Add unittests for str_to_date, fix #3556, #3557 Dec 6, 2021
@ti-chi-bot ti-chi-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 7, 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 Dec 11, 2021
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 13, 2021
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 13, 2021
@ti-chi-bot
Copy link
Member

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

Commit hash: fbbf522

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 14, 2021
@sre-bot
Copy link
Collaborator

sre-bot commented Dec 14, 2021

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/363/cobertura/
(Coverage detail url is limited office network access)

lines: 42.3% (46937 out of 110981)
branches: 6.0% (72504 out of 1206097)

@sre-bot
Copy link
Collaborator

sre-bot commented Dec 14, 2021

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/368/cobertura/
(Coverage detail url is limited office network access)

lines: 42.3% (46953 out of 111001)
branches: 6.0% (72522 out of 1206117)

@ti-chi-bot ti-chi-bot merged commit 4b4b8b4 into pingcap:master Dec 14, 2021
@JaySon-Huang JaySon-Huang added needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 needs-cherry-pick-release-5.2 PR which needs to be cherry-picked to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 labels Jan 24, 2022
@JaySon-Huang JaySon-Huang deleted the str_to_date_ut branch January 24, 2022 08:07
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Jan 24, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3933.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Jan 24, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3934.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Jan 24, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3935.

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Jan 24, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #3936.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 26, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Jan 26, 2022

Coverage detail: https://ci-internal.pingcap.net/job/tics_ghpr_unit_test/1262/cobertura/
(Coverage detail url is limited office network access)

lines: 42.3% (46956 out of 111001)
branches: 6.0% (72531 out of 1206117)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.0 PR which needs to be cherry-picked to release-5.0 needs-cherry-pick-release-5.1 PR which needs to be cherry-picked to release-5.1 needs-cherry-pick-release-5.2 PR which needs to be cherry-picked to release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
5 participants