Skip to content

Commit f024eb2

Browse files
committed
This is an automated cherry-pick of pingcap#54553
Signed-off-by: ti-chi-bot <[email protected]>
1 parent 55eefb6 commit f024eb2

File tree

81 files changed

+4382
-19
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+4382
-19
lines changed

pkg/executor/aggfuncs/func_group_concat.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"sync/atomic"
2222
"unsafe"
2323

24+
"github.com/pingcap/errors"
2425
"github.com/pingcap/tidb/pkg/expression"
2526
plannercore "github.com/pingcap/tidb/pkg/planner/core"
2627
"github.com/pingcap/tidb/pkg/planner/util"
@@ -72,10 +73,17 @@ func (e *baseGroupConcat4String) AppendFinalResult2Chunk(_ sessionctx.Context, p
7273

7374
func (e *baseGroupConcat4String) handleTruncateError(sctx sessionctx.Context) (err error) {
7475
if atomic.CompareAndSwapInt32(e.truncated, 0, 1) {
76+
<<<<<<< HEAD
7577
if !sctx.GetSessionVars().StmtCtx.TruncateAsWarning {
7678
return expression.ErrCutValueGroupConcat.GenWithStackByArgs(e.args[0].String())
7779
}
7880
sctx.GetSessionVars().StmtCtx.AppendWarning(expression.ErrCutValueGroupConcat.GenWithStackByArgs(e.args[0].String()))
81+
=======
82+
if !tc.Flags().TruncateAsWarning() {
83+
return expression.ErrCutValueGroupConcat.GenWithStackByArgs(e.args[0].StringWithCtx(ctx, errors.RedactLogDisable))
84+
}
85+
tc.AppendWarning(expression.ErrCutValueGroupConcat.FastGenByArgs(e.args[0].StringWithCtx(ctx, errors.RedactLogDisable)))
86+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
7987
}
8088
return nil
8189
}

pkg/executor/importer/import.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,11 @@ func (p *Plan) initParameters(plan *plannercore.ImportInto) error {
756756
optionMap := make(map[string]interface{}, len(plan.Options))
757757
for _, opt := range plan.Options {
758758
if opt.Value != nil {
759+
<<<<<<< HEAD
759760
val := opt.Value.String()
761+
=======
762+
val := opt.Value.StringWithCtx(evalCtx, errors.RedactLogDisable)
763+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
760764
if opt.Name == cloudStorageURIOption {
761765
val = ast.RedactURL(val)
762766
}

pkg/expression/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ go_library(
105105
"//pkg/util/password-validation",
106106
"//pkg/util/plancodec",
107107
"//pkg/util/printer",
108+
"//pkg/util/redact",
108109
"//pkg/util/sem",
109110
"//pkg/util/set",
110111
"//pkg/util/size",

pkg/expression/aggregation/agg_to_pb.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ func AggFuncToPBExpr(sctx sessionctx.Context, client kv.Client, aggFunc *AggFunc
111111
for _, arg := range aggFunc.Args {
112112
pbArg := pc.ExprToPB(arg)
113113
if pbArg == nil {
114+
<<<<<<< HEAD
114115
return nil, errors.New(aggFunc.String() + " can't be converted to PB.")
116+
=======
117+
return nil, errors.New(aggFunc.StringWithCtx(ctx.EvalCtx(), errors.RedactLogDisable) + " can't be converted to PB.")
118+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
115119
}
116120
children = append(children, pbArg)
117121
}
@@ -126,7 +130,11 @@ func AggFuncToPBExpr(sctx sessionctx.Context, client kv.Client, aggFunc *AggFunc
126130
for _, arg := range aggFunc.OrderByItems {
127131
pbArg := expression.SortByItemToPB(sc, client, arg.Expr, arg.Desc)
128132
if pbArg == nil {
133+
<<<<<<< HEAD
129134
return nil, errors.New(aggFunc.String() + " can't be converted to PB.")
135+
=======
136+
return nil, errors.New(aggFunc.StringWithCtx(ctx.EvalCtx(), errors.RedactLogDisable) + " can't be converted to PB.")
137+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
130138
}
131139
orderBy = append(orderBy, pbArg)
132140
}

pkg/expression/aggregation/base_func.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,21 @@ func (a *baseFuncDesc) clone() *baseFuncDesc {
7171
return &clone
7272
}
7373

74+
<<<<<<< HEAD
7475
// String implements the fmt.Stringer interface.
7576
func (a *baseFuncDesc) String() string {
7677
buffer := bytes.NewBufferString(a.Name)
7778
buffer.WriteString("(")
7879
for i, arg := range a.Args {
7980
buffer.WriteString(arg.String())
81+
=======
82+
// StringWithCtx returns the string within given context.
83+
func (a *baseFuncDesc) StringWithCtx(ctx expression.ParamValues, redact string) string {
84+
buffer := bytes.NewBufferString(a.Name)
85+
buffer.WriteString("(")
86+
for i, arg := range a.Args {
87+
buffer.WriteString(arg.StringWithCtx(ctx, redact))
88+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
8089
if i+1 != len(a.Args) {
8190
buffer.WriteString(", ")
8291
}
@@ -150,7 +159,11 @@ func (a *baseFuncDesc) typeInfer4ApproxPercentile(ctx sessionctx.Context) error
150159
}
151160
percent, isNull, err := a.Args[1].EvalInt(ctx, chunk.Row{})
152161
if err != nil {
162+
<<<<<<< HEAD
153163
return fmt.Errorf("APPROX_PERCENTILE: Invalid argument %s", a.Args[1].String())
164+
=======
165+
return fmt.Errorf("APPROX_PERCENTILE: Invalid argument %s", a.Args[1].StringWithCtx(ctx, errors.RedactLogDisable))
166+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
154167
}
155168
if percent <= 0 || percent > 100 || isNull {
156169
if isNull {

pkg/expression/aggregation/concat.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ func (cf *concatFunction) Update(evalCtx *AggEvaluateContext, sc *stmtctx.Statem
104104
}
105105
evalCtx.Buffer.Truncate(i)
106106
if !cf.truncated {
107+
<<<<<<< HEAD
107108
sc.AppendWarning(expression.ErrCutValueGroupConcat.GenWithStackByArgs(cf.Args[0].String()))
109+
=======
110+
sc.AppendWarning(expression.ErrCutValueGroupConcat.FastGenByArgs(cf.Args[0].StringWithCtx(evalCtx.Ctx, errors.RedactLogDisable)))
111+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
108112
}
109113
cf.truncated = true
110114
}

pkg/expression/aggregation/descriptor.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,24 @@ func NewAggFuncDescForWindowFunc(ctx sessionctx.Context, desc *WindowFuncDesc, h
6464
return &AggFuncDesc{baseFuncDesc: baseFuncDesc{desc.Name, desc.Args, desc.RetTp}, HasDistinct: hasDistinct}, nil
6565
}
6666

67+
<<<<<<< HEAD
6768
// String implements the fmt.Stringer interface.
6869
func (a *AggFuncDesc) String() string {
70+
=======
71+
// StringWithCtx returns the string representation within given ctx.
72+
func (a *AggFuncDesc) StringWithCtx(ctx expression.ParamValues, redact string) string {
73+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
6974
buffer := bytes.NewBufferString(a.Name)
7075
buffer.WriteString("(")
7176
if a.HasDistinct {
7277
buffer.WriteString("distinct ")
7378
}
7479
for i, arg := range a.Args {
80+
<<<<<<< HEAD
7581
buffer.WriteString(arg.String())
82+
=======
83+
buffer.WriteString(arg.StringWithCtx(ctx, redact))
84+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
7685
if i+1 != len(a.Args) {
7786
buffer.WriteString(", ")
7887
}
@@ -81,7 +90,11 @@ func (a *AggFuncDesc) String() string {
8190
buffer.WriteString(" order by ")
8291
}
8392
for i, arg := range a.OrderByItems {
93+
<<<<<<< HEAD
8494
buffer.WriteString(arg.String())
95+
=======
96+
buffer.WriteString(arg.StringWithCtx(ctx, redact))
97+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
8598
if i+1 != len(a.OrderByItems) {
8699
buffer.WriteString(", ")
87100
}

pkg/expression/bench_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"time"
3030

3131
"github.com/google/uuid"
32+
perrors "github.com/pingcap/errors"
3233
"github.com/pingcap/tidb/pkg/parser/ast"
3334
"github.com/pingcap/tidb/pkg/parser/auth"
3435
"github.com/pingcap/tidb/pkg/parser/charset"
@@ -1379,7 +1380,11 @@ func benchmarkVectorizedEvalOneVec(b *testing.B, vecExprCases vecExprBenchCases)
13791380
for funcName, testCases := range vecExprCases {
13801381
for _, testCase := range testCases {
13811382
expr, _, input, output := genVecExprBenchCase(ctx, funcName, testCase)
1383+
<<<<<<< HEAD
13821384
exprName := expr.String()
1385+
=======
1386+
exprName := expr.StringWithCtx(ctx, perrors.RedactLogDisable)
1387+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
13831388
if sf, ok := expr.(*ScalarFunction); ok {
13841389
exprName = fmt.Sprintf("%v", reflect.TypeOf(sf.Function))
13851390
tmp := strings.Split(exprName, ".")

pkg/expression/builtin_arithmetic.go

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"fmt"
1919
"math"
2020

21+
"github.com/pingcap/errors"
2122
"github.com/pingcap/tidb/pkg/parser/mysql"
2223
"github.com/pingcap/tidb/pkg/parser/terror"
2324
"github.com/pingcap/tidb/pkg/sessionctx"
@@ -231,6 +232,7 @@ func (s *builtinArithmeticPlusIntSig) evalInt(row chunk.Row) (val int64, isNull
231232
switch {
232233
case isLHSUnsigned && isRHSUnsigned:
233234
if uint64(a) > math.MaxUint64-uint64(b) {
235+
<<<<<<< HEAD
234236
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].String(), s.args[1].String()))
235237
}
236238
case isLHSUnsigned && !isRHSUnsigned:
@@ -250,6 +252,27 @@ func (s *builtinArithmeticPlusIntSig) evalInt(row chunk.Row) (val int64, isNull
250252
case !isLHSUnsigned && !isRHSUnsigned:
251253
if (a > 0 && b > math.MaxInt64-a) || (a < 0 && b < math.MinInt64-a) {
252254
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s + %s)", s.args[0].String(), s.args[1].String()))
255+
=======
256+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
257+
}
258+
case isLHSUnsigned && !isRHSUnsigned:
259+
if b < 0 && uint64(-b) > uint64(a) {
260+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
261+
}
262+
if b > 0 && uint64(a) > math.MaxUint64-uint64(b) {
263+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
264+
}
265+
case !isLHSUnsigned && isRHSUnsigned:
266+
if a < 0 && uint64(-a) > uint64(b) {
267+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
268+
}
269+
if a > 0 && uint64(b) > math.MaxUint64-uint64(a) {
270+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
271+
}
272+
case !isLHSUnsigned && !isRHSUnsigned:
273+
if (a > 0 && b > math.MaxInt64-a) || (a < 0 && b < math.MinInt64-a) {
274+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
275+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
253276
}
254277
}
255278

@@ -279,7 +302,11 @@ func (s *builtinArithmeticPlusDecimalSig) evalDecimal(row chunk.Row) (*types.MyD
279302
err = types.DecimalAdd(a, b, c)
280303
if err != nil {
281304
if err == types.ErrOverflow {
305+
<<<<<<< HEAD
282306
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s + %s)", s.args[0].String(), s.args[1].String()))
307+
=======
308+
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
309+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
283310
}
284311
return nil, true, err
285312
}
@@ -309,7 +336,11 @@ func (s *builtinArithmeticPlusRealSig) evalReal(row chunk.Row) (float64, bool, e
309336
return 0, true, nil
310337
}
311338
if !mathutil.IsFinite(a + b) {
339+
<<<<<<< HEAD
312340
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s + %s)", s.args[0].String(), s.args[1].String()))
341+
=======
342+
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s + %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
343+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
313344
}
314345
return a + b, false, nil
315346
}
@@ -375,7 +406,11 @@ func (s *builtinArithmeticMinusRealSig) evalReal(row chunk.Row) (float64, bool,
375406
return 0, isNull, err
376407
}
377408
if !mathutil.IsFinite(a - b) {
409+
<<<<<<< HEAD
378410
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s - %s)", s.args[0].String(), s.args[1].String()))
411+
=======
412+
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s - %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
413+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
379414
}
380415
return a - b, false, nil
381416
}
@@ -403,7 +438,11 @@ func (s *builtinArithmeticMinusDecimalSig) evalDecimal(row chunk.Row) (*types.My
403438
err = types.DecimalSub(a, b, c)
404439
if err != nil {
405440
if err == types.ErrOverflow {
441+
<<<<<<< HEAD
406442
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s - %s)", s.args[0].String(), s.args[1].String()))
443+
=======
444+
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s - %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
445+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
407446
}
408447
return nil, true, err
409448
}
@@ -441,7 +480,11 @@ func (s *builtinArithmeticMinusIntSig) evalInt(row chunk.Row) (val int64, isNull
441480
}
442481
overflow := s.overflowCheck(isLHSUnsigned, isRHSUnsigned, signed, a, b)
443482
if overflow {
483+
<<<<<<< HEAD
444484
return 0, true, types.ErrOverflow.GenWithStackByArgs(errType, fmt.Sprintf("(%s - %s)", s.args[0].String(), s.args[1].String()))
485+
=======
486+
return 0, true, types.ErrOverflow.GenWithStackByArgs(errType, fmt.Sprintf("(%s - %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
487+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
445488
}
446489

447490
return a - b, false, nil
@@ -586,7 +629,11 @@ func (s *builtinArithmeticMultiplyRealSig) evalReal(row chunk.Row) (float64, boo
586629
}
587630
result := a * b
588631
if math.IsInf(result, 0) {
632+
<<<<<<< HEAD
589633
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s * %s)", s.args[0].String(), s.args[1].String()))
634+
=======
635+
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s * %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
636+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
590637
}
591638
return result, false, nil
592639
}
@@ -604,7 +651,11 @@ func (s *builtinArithmeticMultiplyDecimalSig) evalDecimal(row chunk.Row) (*types
604651
err = types.DecimalMul(a, b, c)
605652
if err != nil && !terror.ErrorEqual(err, types.ErrTruncated) {
606653
if err == types.ErrOverflow {
654+
<<<<<<< HEAD
607655
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s * %s)", s.args[0].String(), s.args[1].String()))
656+
=======
657+
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s * %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
658+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
608659
}
609660
return nil, true, err
610661
}
@@ -624,7 +675,11 @@ func (s *builtinArithmeticMultiplyIntUnsignedSig) evalInt(row chunk.Row) (val in
624675
unsignedB := uint64(b)
625676
result := unsignedA * unsignedB
626677
if unsignedA != 0 && result/unsignedA != unsignedB {
678+
<<<<<<< HEAD
627679
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s * %s)", s.args[0].String(), s.args[1].String()))
680+
=======
681+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s * %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
682+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
628683
}
629684
return int64(result), false, nil
630685
}
@@ -640,7 +695,11 @@ func (s *builtinArithmeticMultiplyIntSig) evalInt(row chunk.Row) (val int64, isN
640695
}
641696
result := a * b
642697
if (a != 0 && result/a != b) || (result == math.MinInt64 && a == -1) {
698+
<<<<<<< HEAD
643699
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s * %s)", s.args[0].String(), s.args[1].String()))
700+
=======
701+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s * %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
702+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
644703
}
645704
return result, false, nil
646705
}
@@ -705,7 +764,11 @@ func (s *builtinArithmeticDivideRealSig) evalReal(row chunk.Row) (float64, bool,
705764
}
706765
result := a / b
707766
if math.IsInf(result, 0) {
767+
<<<<<<< HEAD
708768
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s / %s)", s.args[0].String(), s.args[1].String()))
769+
=======
770+
return 0, true, types.ErrOverflow.GenWithStackByArgs("DOUBLE", fmt.Sprintf("(%s / %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
771+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
709772
}
710773
return result, false, nil
711774
}
@@ -734,7 +797,11 @@ func (s *builtinArithmeticDivideDecimalSig) evalDecimal(row chunk.Row) (*types.M
734797
err = c.Round(c, s.baseBuiltinFunc.tp.GetDecimal(), types.ModeHalfUp)
735798
}
736799
} else if err == types.ErrOverflow {
800+
<<<<<<< HEAD
737801
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s / %s)", s.args[0].String(), s.args[1].String()))
802+
=======
803+
err = types.ErrOverflow.GenWithStackByArgs("DECIMAL", fmt.Sprintf("(%s / %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
804+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
738805
}
739806
return c, false, err
740807
}
@@ -869,14 +936,22 @@ func (s *builtinArithmeticIntDivideDecimalSig) evalInt(row chunk.Row) (ret int64
869936
ret = int64(0)
870937
return ret, false, nil
871938
}
939+
<<<<<<< HEAD
872940
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s DIV %s)", s.args[0].String(), s.args[1].String()))
941+
=======
942+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s DIV %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
943+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
873944
}
874945
ret = int64(val)
875946
} else {
876947
ret, err = c.ToInt()
877948
// err returned by ToInt may be ErrTruncated or ErrOverflow, only handle ErrOverflow, ignore ErrTruncated.
878949
if err == types.ErrOverflow {
950+
<<<<<<< HEAD
879951
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s DIV %s)", s.args[0].String(), s.args[1].String()))
952+
=======
953+
return 0, true, types.ErrOverflow.GenWithStackByArgs("BIGINT", fmt.Sprintf("(%s DIV %s)", s.args[0].StringWithCtx(ctx, errors.RedactLogDisable), s.args[1].StringWithCtx(ctx, errors.RedactLogDisable)))
954+
>>>>>>> f5ac1c4a453 (*: support tidb_redact_log for explain (#54553))
880955
}
881956
}
882957

0 commit comments

Comments
 (0)