Skip to content

Commit

Permalink
tables: disable UpdateDeltaForTable if TxnCtx is nil (#15047)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm authored Mar 3, 2020
1 parent 9a882c4 commit 495f8b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions table/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 495f8b7

Please sign in to comment.