-
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
ddl: add data structure SubJob
for multi-schema change
#35231
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@@ -1456,9 +1456,6 @@ func GetColDefaultValue(ctx sessionctx.Context, col *table.Column, defaultVals [ | |||
if col.GetOriginDefaultValue() == nil && mysql.HasNotNullFlag(col.GetFlag()) { | |||
return colVal, errors.New("Miss column") | |||
} | |||
if col.State != model.StatePublic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove it? Is it safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider the case:
create table t (a tinyint);
insert into t set a = 10 ;
alter table t add column b int not null, change column a c char(5) first;
In this ALTER TABLE statement, we add a NOT NULL column first, and then do the lossy column type change. In the phase of backfilling, the schema state of column b
is still "write-reorg". If we keep this code, a null value is assigned to the column b
, which violates the not-null constraint. Also see tangenta#94.
I don't see if there are any benefits to get a null value for the middle-state column... so let it be the real default value.
No tests are broken by this change.
No other tests except TestColumnAdd
are broken by this change.
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/6a94b8a4dc79debfe7f681e9781f9ca08b9cefee |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 6a94b8a
|
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: ref #14766
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.