-
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
*: do not return row not match parition error when using update ingore
#50134
Conversation
@@ -186,15 +186,17 @@ func updateRecord( | |||
memBuffer.Release(sh) | |||
return true, nil | |||
}(); err != nil { | |||
if terr, ok := errors.Cause(err).(*terror.Error); sctx.GetSessionVars().StmtCtx.IgnoreNoPartition && ok && terr.Code() == errno.ErrNoPartitionForGivenValue { | |||
if terr, ok := errors.Cause(err).(*terror.Error); sctx.GetSessionVars().StmtCtx.IgnoreNoPartition && ok && (terr.Code() == errno.ErrNoPartitionForGivenValue || terr.Code() == errno.ErrRowDoesNotMatchGivenPartitionSet) { | |||
sctx.GetSessionVars().StmtCtx.AppendWarning(err) |
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 should append error to warning when "update/insert ignore" to keep the behavior same with mysql
@@ -7,7 +7,7 @@ partition by list (id*2 + b*b + b*b - b*b*2 - abs(id)) ( | |||
partition p0 values in (3,5,6,9,17), | |||
partition p1 values in (1,2,10,11,19,20), | |||
partition p2 values in (4,12,13,14,18), | |||
partition p3 values in (7,8,15,16,null) | |||
partition p3 values in (7,8,15,16,27,null) |
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.
This modification here is to make the later test stable:
update t set id=id+17 where id in (3,10);
Error 1062 (23000): Duplicate entry '20-2' for key 't.idx'
Without this line of change, there will be two errors in the statement and any of them can be returned first.
update ingore
update ingore
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, YangKeao 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:
|
/retest |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #50134 +/- ##
=================================================
- Coverage 79.3242% 67.2832% -12.0410%
=================================================
Files 2445 2558 +113
Lines 673508 839885 +166377
=================================================
+ Hits 534255 565102 +30847
- Misses 117867 251099 +133232
- Partials 21386 23684 +2298
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test all |
@lcwangchao: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #50128
What changed and how does it work?
update ignore ...
, error should not return to userupdate ignore
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.