Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#50134
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
lcwangchao authored and ti-chi-bot committed Jan 8, 2024
1 parent cd073ea commit 932cea6
Show file tree
Hide file tree
Showing 4 changed files with 2,360 additions and 2 deletions.
6 changes: 4 additions & 2 deletions executor/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,17 @@ func updateRecord(ctx context.Context, sctx sessionctx.Context, h kv.Handle, old
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)
return false, nil
}
return updated, err
}
} else {
// Update record to new value and update index.
if err := t.UpdateRecord(ctx, sctx, h, oldData, newData, modified); 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)
return false, nil
}
return false, err
Expand Down
Loading

0 comments on commit 932cea6

Please sign in to comment.