@@ -549,7 +549,8 @@ func (t *TableCommon) UpdateRecord(ctx context.Context, sctx sessionctx.Context,
549
549
key := t .RecordKey (h )
550
550
sc , rd := sessVars .StmtCtx , & sessVars .RowEncoder
551
551
checksums , writeBufs .RowValBuf = t .calcChecksums (sctx , h , checksumData , writeBufs .RowValBuf )
552
- writeBufs .RowValBuf , err = tablecodec .EncodeRow (sc , row , colIDs , writeBufs .RowValBuf , writeBufs .AddRowValues , rd , checksums ... )
552
+ writeBufs .RowValBuf , err = tablecodec .EncodeRow (sc .TimeZone (), row , colIDs , writeBufs .RowValBuf , writeBufs .AddRowValues , rd , checksums ... )
553
+ err = sc .HandleError (err )
553
554
if err != nil {
554
555
return err
555
556
}
@@ -988,7 +989,8 @@ func (t *TableCommon) AddRecord(sctx sessionctx.Context, r []types.Datum, opts .
988
989
zap .Stringer ("key" , key ))
989
990
sc , rd := sessVars .StmtCtx , & sessVars .RowEncoder
990
991
checksums , writeBufs .RowValBuf = t .calcChecksums (sctx , recordID , checksumData , writeBufs .RowValBuf )
991
- writeBufs .RowValBuf , err = tablecodec .EncodeRow (sc , row , colIDs , writeBufs .RowValBuf , writeBufs .AddRowValues , rd , checksums ... )
992
+ writeBufs .RowValBuf , err = tablecodec .EncodeRow (sc .TimeZone (), row , colIDs , writeBufs .RowValBuf , writeBufs .AddRowValues , rd , checksums ... )
993
+ err = sc .HandleError (err )
992
994
if err != nil {
993
995
return nil , err
994
996
}
@@ -1395,7 +1397,8 @@ func (t *TableCommon) addInsertBinlog(ctx sessionctx.Context, h kv.Handle, row [
1395
1397
if err != nil {
1396
1398
return err
1397
1399
}
1398
- value , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx , row , colIDs , nil , nil )
1400
+ value , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx .TimeZone (), row , colIDs , nil , nil )
1401
+ err = ctx .GetSessionVars ().StmtCtx .HandleError (err )
1399
1402
if err != nil {
1400
1403
return err
1401
1404
}
@@ -1406,11 +1409,13 @@ func (t *TableCommon) addInsertBinlog(ctx sessionctx.Context, h kv.Handle, row [
1406
1409
}
1407
1410
1408
1411
func (t * TableCommon ) addUpdateBinlog (ctx sessionctx.Context , oldRow , newRow []types.Datum , colIDs []int64 ) error {
1409
- old , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx , oldRow , colIDs , nil , nil )
1412
+ old , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx .TimeZone (), oldRow , colIDs , nil , nil )
1413
+ err = ctx .GetSessionVars ().StmtCtx .HandleError (err )
1410
1414
if err != nil {
1411
1415
return err
1412
1416
}
1413
- newVal , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx , newRow , colIDs , nil , nil )
1417
+ newVal , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx .TimeZone (), newRow , colIDs , nil , nil )
1418
+ err = ctx .GetSessionVars ().StmtCtx .HandleError (err )
1414
1419
if err != nil {
1415
1420
return err
1416
1421
}
@@ -1422,7 +1427,8 @@ func (t *TableCommon) addUpdateBinlog(ctx sessionctx.Context, oldRow, newRow []t
1422
1427
}
1423
1428
1424
1429
func (t * TableCommon ) addDeleteBinlog (ctx sessionctx.Context , r []types.Datum , colIDs []int64 ) error {
1425
- data , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx , r , colIDs , nil , nil )
1430
+ data , err := tablecodec .EncodeOldRow (ctx .GetSessionVars ().StmtCtx .TimeZone (), r , colIDs , nil , nil )
1431
+ err = ctx .GetSessionVars ().StmtCtx .HandleError (err )
1426
1432
if err != nil {
1427
1433
return err
1428
1434
}
@@ -2316,7 +2322,8 @@ func SetPBColumnsDefaultValue(ctx sessionctx.Context, pbColumns []*tipb.ColumnIn
2316
2322
return err
2317
2323
}
2318
2324
2319
- pbColumns [i ].DefaultVal , err = tablecodec .EncodeValue (sessVars .StmtCtx , nil , d )
2325
+ pbColumns [i ].DefaultVal , err = tablecodec .EncodeValue (sessVars .StmtCtx .TimeZone (), nil , d )
2326
+ err = sessVars .StmtCtx .HandleError (err )
2320
2327
if err != nil {
2321
2328
return err
2322
2329
}
0 commit comments