-
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
*: incorrect error message of inserting enum & set (#19380) #19950
*: incorrect error message of inserting enum & set (#19380) #19950
Conversation
Signed-off-by: ti-srebot <[email protected]>
/run-all-tests |
table/column.go
Outdated
@@ -181,7 +181,11 @@ func CastValue(ctx sessionctx.Context, val types.Datum, col *model.ColumnInfo, r | |||
if types.ErrOverflow.Equal(err) && returnOverflow { | |||
return casted, err | |||
} | |||
<<<<<<< HEAD |
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.
Please fix the conflict @Patrick0308 .
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 I need create a new pr to fix this problem?
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.
What should I do? @qw4990
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.
CI failed, you may resolve the conflicts and file a new PR
LGTM |
PTAL @qw4990 |
@@ -181,7 +181,7 @@ func CastValue(ctx sessionctx.Context, val types.Datum, col *model.ColumnInfo, r | |||
if types.ErrOverflow.Equal(err) && returnOverflow { | |||
return casted, err | |||
} | |||
if types.ErrTruncated.Equal(err) { | |||
if err != nil && types.ErrTruncated.Equal(err) && col.Tp != mysql.TypeSet && col.Tp != mysql.TypeEnum { |
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.
We don't need err!=nil
because in types.ErrTruncated.Equal(err)
fix nil problem.
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.
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
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
cherry-pick #19380 to release-4.0
What problem does this PR solve?
Issue Number: close #19229
Problem Summary:
What is changed and how it works?
What's Changed: Change error code and error info when insert value.
Check List
Tests
Release note