From 495f8b74382fb31924b4948374c0dbba6f2d87cd Mon Sep 17 00:00:00 2001 From: kennytm Date: Tue, 3 Mar 2020 11:16:09 +0800 Subject: [PATCH] tables: disable UpdateDeltaForTable if TxnCtx is nil (#15047) --- table/tables/tables.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/table/tables/tables.go b/table/tables/tables.go index 640bcd58a1772..6a74450958a7e 100644 --- a/table/tables/tables.go +++ b/table/tables/tables.go @@ -590,6 +590,9 @@ func (t *TableCommon) AddRecord(ctx sessionctx.Context, r []types.Datum, opts .. } } sc.AddAffectedRows(1) + if sessVars.TxnCtx == nil { + return recordID, nil + } colSize := make(map[int64]int64, len(r)) for id, col := range t.Cols() { size, err := codec.EstimateValueSize(sc, r[id])