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: fix that str_to_date returns different result on no zero date sql mode. #39316

Merged
merged 5 commits into from
Nov 24, 2022

Conversation

mengxin9014
Copy link
Contributor

@mengxin9014 mengxin9014 commented Nov 22, 2022

What problem does this PR solve?

Issue Number: close #39146

Problem Summary:

What is changed and how it works?

fix that str_to_date returns different result on no zero date sql mode

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

Please refer to Release Notes Language Style Guide to write a quality release note.

fix that str_to_date returns different result on no zero date sql mode.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 22, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • XuHuaiyu
  • windtalker

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 do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/needs-triage-completed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 22, 2022
@mengxin9014
Copy link
Contributor Author

/run-all-tests

@ti-chi-bot ti-chi-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 22, 2022
@mengxin9014 mengxin9014 changed the title WIP: expression: fix that str_to_date returns different result on no zero date sql mode. expression: fix that str_to_date returns different result on no zero date sql mode. Nov 23, 2022
@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 Nov 23, 2022
}
result.SetNull(i, true)
continue
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like non-vector mode has already fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like non-vector mode has already fix this?

Yes, the non-vector mode ignores the value of hasNoZeroDateMode.

tk.MustExec("CREATE TABLE `sun` ( `dest` varchar(10) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;")
tk.MustExec("insert into sun values('20231020');")
tk.MustExec("set @@sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';")
tk.MustQuery(`select str_to_date(substr(dest,1,6),'%H%i%s') from sun;`).Check(testkit.Rows("20:23:10"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Please test both vector and non-vector execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please test both vector and non-vector execution.

done.

Copy link
Contributor

@windtalker windtalker 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 status/LGT1 Indicates that a PR has LGTM 1. needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. and removed do-not-merge/needs-triage-completed labels Nov 24, 2022
@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 Nov 24, 2022
@mengxin9014
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@mengxin9014: /merge is only allowed for the committers, you can assign this pull request to the committer in list by filling /assign @committer in the comment to help merge this pull request.

In response to this:

/merge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@XuHuaiyu
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 3a44b62

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 24, 2022
@ti-chi-bot ti-chi-bot merged commit 7930c2c into pingcap:master Nov 24, 2022
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

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

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

@sre-bot
Copy link
Contributor

sre-bot commented Nov 24, 2022

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged.
These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci/integration-cdc-test 🟥 failed 1, success 38, total 39 25 min New failing
idc-jenkins-ci-tidb/sqllogic-test-2 🔴 failed 4, success 24, total 28 21 min Existing failure
idc-jenkins-ci-tidb/mybatis-test 🔴 failed 1, success 0, total 1 11 min Existing failure
idc-jenkins-ci-tidb/integration-ddl-test 🔴 failed 1, success 5, total 6 5 min 22 sec Existing failure
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 15 min Existing passed
idc-jenkins-ci-tidb/integration-common-test 🟢 all 17 tests passed 13 min Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 42 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 5 min 29 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 6 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

@mengxin9014 mengxin9014 deleted the mx/fixIssue39146 branch November 24, 2022 10:26
@mengxin9014
Copy link
Contributor Author

/label needs-cherry-pick-release-6.2

@mengxin9014
Copy link
Contributor Author

/label needs-cherry-pick-release-6.3

@mengxin9014
Copy link
Contributor Author

/label needs-cherry-pick-release-6.4

@ti-chi-bot
Copy link
Member

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

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

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot added a commit that referenced this pull request Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

str_to_date return different result on no zero date sql mode
5 participants