diff --git a/executor/load_data.go b/executor/load_data.go index 8bc586a7825f2..7949f76e3aebc 100644 --- a/executor/load_data.go +++ b/executor/load_data.go @@ -318,6 +318,7 @@ func (e *LoadDataInfo) addRecordLD(row []types.Datum) (int64, error) { h, err := e.addRecord(row) if err != nil { e.handleWarning(err) + return 0, err } return h, nil } diff --git a/server/conn.go b/server/conn.go index 0c589786cb8d5..4ae0b0a145c2f 100644 --- a/server/conn.go +++ b/server/conn.go @@ -1071,6 +1071,7 @@ func insertDataWithCommit(ctx context.Context, prevData, curData []byte, loadDat if !reachLimit { break } + start := time.Now() if err = loadDataInfo.Ctx.StmtCommit(); err != nil { return nil, err } @@ -1080,6 +1081,7 @@ func insertDataWithCommit(ctx context.Context, prevData, curData []byte, loadDat } curData = prevData prevData = nil + logutil.Logger(ctx).Info("commit one task finished", zap.Duration("commit time usage", time.Since(start))) } return prevData, nil }