-
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
executor: do not use batchChecker in 'insert ignore into ...' #12122
Conversation
batchChecker is difficult to maintain, we should get rid of it. In this commit I catch the BatchGet result into the snapshot, in this way we can achieve the same goal as the batchChecker
Please resolve the conflicts. |
Codecov Report
@@ Coverage Diff @@
## master #12122 +/- ##
===============================================
+ Coverage 81.382% 81.5083% +0.1262%
===============================================
Files 450 449 -1
Lines 96767 97390 +623
===============================================
+ Hits 78751 79381 +630
+ Misses 12392 12385 -7
Partials 5624 5624 |
/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
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
@@ -149,9 +149,9 @@ func prefetchDataCache(ctx context.Context, txn kv.Transaction, rows []toBeCheck | |||
return prefetchConflictedOldRows(ctx, txn, rows, values) | |||
} | |||
|
|||
// updateDupRowNew updates a duplicate row to a new row. | |||
func (e *InsertExec) updateDupRowNew(ctx context.Context, txn kv.Transaction, row toBeCheckedRow, handle int64, onDuplicate []*expression.Assignment) error { | |||
oldRow, err := e.getOldRowNew(ctx, e.ctx, txn, row.t, handle, e.GenExprs) |
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.
so batchChecker) getOldRowNew
can be remove now~?
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.
Not now, the replace ...
is still using it.
I'll remove it later...
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.
tidb/executor/batch_checker.go
Line 297 in dd11b55
func (b *batchChecker) getOldRowNew(ctx context.Context, sctx sessionctx.Context, txn kv.Transaction, t table.Table, handle int64, |
What problem does this PR solve?
Continue with #12108, please review this PR after it's merged.
After this commit, the insert operations do not use the
batchChecker
anymore.What is changed and how it works?
Refactoring code.
Implement the 'insert ignore into ...' operation without the
batchChecker
Check List
Tests
Release note