diff --git a/expression/expression_test.go b/expression/expression_test.go index e80cf5c41d575..63df451c98a37 100644 --- a/expression/expression_test.go +++ b/expression/expression_test.go @@ -77,7 +77,7 @@ func TestEvaluateExprWithNullAndParameters(t *testing.T) { res = EvaluateExprWithNull(ctx, schema, ltWithParam) _, isConst := res.(*Constant) require.True(t, isConst) // this expression is evaluated and skip-plan cache flag is set. - require.True(t, ctx.GetSessionVars().StmtCtx.SkipPlanCache) + require.True(t, ctx.GetSessionVars().StmtCtx.UseCache) } func TestEvaluateExprWithNullNoChangeRetType(t *testing.T) { diff --git a/planner/core/expression_rewriter.go b/planner/core/expression_rewriter.go index 570a030a626fd..fcc81790cf074 100644 --- a/planner/core/expression_rewriter.go +++ b/planner/core/expression_rewriter.go @@ -1553,12 +1553,7 @@ func (er *expressionRewriter) inToExpression(lLen int, not bool, tp *types.Field if c.GetType().EvalType() == types.ETInt { continue // no need to refine it } -<<<<<<< HEAD er.sctx.GetSessionVars().StmtCtx.SetSkipPlanCache(errors.Errorf("skip plan-cache: '%v' may be converted to INT", c.String())) -======= - } else if !er.sctx.GetSessionVars().StmtCtx.UseCache { - // We should remove the mutable constant for correctness, because its value may be changed. ->>>>>>> ffaf2ac9eee (planner: remove the unnecessary skip-plan-cache flag in StmtCtx (#40235)) expression.RemoveMutableConst(er.sctx, []expression.Expression{c}) } args[i], isExceptional = expression.RefineComparedConstant(er.sctx, *leftFt, c, opcode.EQ)