Skip to content

Commit

Permalink
update enablement rule: use
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <ekexium@gmail.com>
  • Loading branch information
ekexium committed Dec 9, 2021
1 parent 995a8e2 commit 909a7aa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,11 @@ func (s *session) doCommit(ctx context.Context) error {

func (s *session) commitTxnWithTemporaryData(ctx context.Context, txn kv.Transaction) error {
sessVars := s.sessionVars
stmtCtx := sessVars.StmtCtx

// Note: ignore auto-commit transactions because auto-commit transactions don't write untouched index mutations
// into the mem buffer, which invalidates the check.
if !s.isInternal() && (stmtCtx.InInsertStmt || stmtCtx.InDeleteStmt || stmtCtx.InUpdateStmt) &&
sessVars.EnableMutationChecker && sessVars.InTxn() {
// Only applies to user DML transactions.
if sessVars.ConnectionID != 0 && sessVars.EnableMutationChecker && sessVars.TxnCtx.IsExplicit {
if err := tables.CheckTxnConsistency(txn); err != nil {
return errors.Trace(err)
}
Expand Down

0 comments on commit 909a7aa

Please sign in to comment.