Skip to content

Commit

Permalink
planner: Removed check for prepared stmt during partition pruning (#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonss authored Sep 20, 2024
1 parent 801e555 commit cf954e2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/planner/core/rule_partition_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1584,13 +1584,6 @@ func (p *rangePruner) extractDataForPrune(sctx base.PlanContext, expr expression
// If the partition expression is col, use constExpr.
constExpr = con
}
// If the partition expression is related with more than one columns such as 'a + b' or 'a * b' or something else,
// the constExpr may not a really constant when coming here.
// Suppose the partition expression is 'a + b' and we have a condition 'a = 2',
// the constExpr is '2 + b' after the replacement which we can't evaluate.
if !expression.ConstExprConsiderPlanCache(constExpr, sctx.GetSessionVars().StmtCtx.UseCache()) {
return ret, false
}
c, isNull, err := constExpr.EvalInt(sctx.GetExprCtx().GetEvalCtx(), chunk.Row{})
if err == nil && !isNull {
ret.c = c
Expand Down

0 comments on commit cf954e2

Please sign in to comment.