-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
admin: fix admin check table err when add column not null, then add index on the column #9108
Conversation
/run-all-tests |
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #9108 +/- ##
==========================================
+ Coverage 67.16% 67.16% +<.01%
==========================================
Files 372 372
Lines 77016 77016
==========================================
+ Hits 51724 51728 +4
+ Misses 20664 20661 -3
+ Partials 4628 4627 -1
Continue to review full report at Codecov.
|
LGTM |
util/admin/admin.go
Outdated
@@ -440,7 +440,7 @@ func CheckRecordAndIndex(sessCtx sessionctx.Context, txn kv.Transaction, t table | |||
for i, val := range vals1 { | |||
col := cols[i] | |||
if val.IsNull() { | |||
if mysql.HasNotNullFlag(col.Flag) { | |||
if mysql.HasNotNullFlag(col.Flag) && col.ToInfo().OriginDefaultValue == nil { | |||
return false, errors.New("Miss") |
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.
It is better to add more detail error information and make diagnose easier. errors.New("Miss")
maybe not a good idea.
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.
Right, we should create a better error message.
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.
done. PTAL
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.
LGTM
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.
LGTM
/run-all-tests |
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.
LGTM
…ndex on the column (pingcap#9108)
…ndex on the column (pingcap#9108)
What problem does this PR solve?
admin check table return error by mistake.
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes