-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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: fix admin check bug #7359
ddl: fix admin check bug #7359
Conversation
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
@crazycs520 Please posts the error information in the description, and explain why your fix work. |
Is it needed to clear other fields in datum as well, for example, field |
Will this bug affect other parts except for AdminCheck? |
@shenli yes, It will affect other parts too. |
@shenli No, it just affects the admin check table. |
/run-all-tests |
|
@shenli the // for datetime
// origin
data1 := Datum{
i:0,
x: Time{
...
},
...
}
// after flatten
data2 := Datum{
i:2440818046768513024,
x: nil,
...
}
// after unflatten
data3 := Datum{
i:2440818046768513024,
x: Time{
...
},
...
} admin check will compare |
@@ -441,6 +441,7 @@ func unflatten(datum types.Datum, ft *types.FieldType, loc *time.Location) (type | |||
return datum, errors.Trace(err) | |||
} | |||
} | |||
datum.SetUint64(0) |
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.
Do we need to clean the i
for TypeDuration?
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.
No, we needn't. d.SetMysqlDuration(x)
will set i
again.
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.
@crazycs520 SetDuration -> SetMysqlDuration
. Inside SetMysqlDuration
, we assign the value of duration to i
after type conversion. So we definitely need clean i
of Datum
in the case of TypeDuration
.
@coocood PTAL |
@breeswish Sorry, I didn’t see yours comment before. |
@crazycs520 Seems like we need to clear other fields when we call |
@coocood What is your opinion? |
/run-all-tests |
988adc4
to
ae85710
Compare
/run-all-tests |
LGTM |
cc @crazycs520 please fix ci failure. |
/run-unit-test |
360ddab
to
52ff828
Compare
/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
What problem does this PR solve?
Use to executed below sqls will error:
The bug is:
When
tablecodec.unflatten()
thedatetime
type, theflatten value
still indatum.i
,we have to clear the
flatten value
to make sure a flattendatum
go through unflatten is deep equal the origindatum
What is changed and how it works?
Check List
Tests