Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Feb 15, 2023
1 parent f073ee0 commit e5c78bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion expression/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 0 additions & 5 deletions planner/core/expression_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e5c78bf

Please sign in to comment.