-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
table: Don't cast date default values (same as timestamp/datetime) | tidb-test=920d9bf1b1137cda1272bdd59ae527aee8067944 #59149
table: Don't cast date default values (same as timestamp/datetime) | tidb-test=920d9bf1b1137cda1272bdd59ae527aee8067944 #59149
Conversation
I guess you might need a tidb-test change for this as well? |
/retest |
/retest |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release-6.5-20241112-v6.5.11 #59149 +/- ##
=================================================================
Coverage ? 73.6096%
=================================================================
Files ? 1097
Lines ? 352928
Branches ? 0
=================================================================
Hits ? 259789
Misses ? 76410
Partials ? 16729 |
@dveeden Done. PTAL |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dveeden, tiancaiamao The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
7683911
into
pingcap:release-6.5-20241112-v6.5.11
This PR is a cherry-pick for #59049 on hotfix branch
What problem does this PR solve?
Issue Number: close #59047
Problem Summary:
During the executor build phase getColDefaultValue is called for the date column and fails, due to trying to cast the default value '0000-00-00' which fails due to default sql_mode.
The underlying issue seems to be that CREATE TABLE does not set column.OriginDefaultValue, while ALTER TABLE ADD COLUMN does, which is ignored in this PR.
What changed and how does it work?
Do as DATETIME and TIMESTAMP, skip cast.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.