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 d04d804 commit 4168551
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions planner/core/expression_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1553,16 +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
}
if c.GetType().EvalType() == types.ETString {
// To keep the result be compatible with MySQL, refine `int non-constant <cmp> str constant`
// here and skip this refine operation in all other cases for safety.
er.sctx.GetSessionVars().StmtCtx.SetSkipPlanCache(errors.Errorf("skip plan-cache: '%v' may be converted to INT", c.String()))
expression.RemoveMutableConst(er.sctx, []expression.Expression{c})
} else {
continue
}
er.sctx.GetSessionVars().StmtCtx.SkipPlanCache = true
er.sctx.GetSessionVars().StmtCtx.AppendWarning(errors.Errorf("skip plan-cache: '%v' may be converted to INT", c.String()))
er.sctx.GetSessionVars().StmtCtx.SetSkipPlanCache(errors.Errorf("skip plan-cache: '%v' may be converted to INT", c.String()))
expression.RemoveMutableConst(er.sctx, []expression.Expression{c})
}
args[i], isExceptional = expression.RefineComparedConstant(er.sctx, *leftFt, c, opcode.EQ)
Expand Down

0 comments on commit 4168551

Please sign in to comment.