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

executor: make NO_ZERO_IN_DATE affect the default values #26828

Merged
merged 13 commits into from
Aug 4, 2021

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Aug 3, 2021

What problem does this PR solve?

Issue Number: close #26766, introduce by #24174

Problem Summary: If the SQL mode NO_ZERO_DATE not exists, StmtContext.IgnoreZeroInDate should not be true.

What is changed and how it works?

NA

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 an issue that NO_ZERO_IN_DATE does not work on the default values.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 3, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • zimulala

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 Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 3, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Aug 3, 2021
// Test create table with invalid datetime(02-30) as a default value.
tk.MustExec("set @@sql_mode='STRICT_TRANS_TABLES';")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to keep this because it is a part of a complete test block for invalid dates like 2999-02-30.

executor/executor_test.go Show resolved Hide resolved
@tangenta tangenta requested a review from zimulala August 3, 2021 11:47
Copy link
Contributor

@zimulala zimulala 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 Aug 4, 2021
@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 Aug 4, 2021
@AilinKid
Copy link
Contributor

AilinKid commented Aug 4, 2021

/merge

@ti-chi-bot
Copy link
Member

@AilinKid: /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.

@tangenta
Copy link
Contributor Author

tangenta commented Aug 4, 2021

/merge

@ti-chi-bot
Copy link
Member

@tangenta: /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.

@AilinKid AilinKid added the sig/sql-infra SIG: SQL Infra label Aug 4, 2021
@AilinKid
Copy link
Contributor

AilinKid commented Aug 4, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 27cdc1a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 4, 2021
@zhouqiang-cl
Copy link
Contributor

/run-unit-tests

@Mini256
Copy link
Member

Mini256 commented Aug 4, 2021

@ti-chi-bot

@Mini256
Copy link
Member

Mini256 commented Aug 4, 2021

@ti-chi-bot

@ti-chi-bot ti-chi-bot merged commit 0c72834 into pingcap:master Aug 4, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 4, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #26902

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 4, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.0 in PR #26903

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Aug 4, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.1 in PR #26904

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 needs-cherry-pick-release-5.1 release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/M Denotes a PR that changes 30-99 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.

expected invalid default value for date default '2020-00-00'
7 participants