Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 authored and ti-chi-bot committed May 18, 2023
1 parent d388b2d commit 408c42e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions expression/builtin_cast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1971,11 +1971,6 @@ func WrapWithCastAsInt(ctx sessionctx.Context, expr Expression) Expression {
tp.SetDecimal(0)
types.SetBinChsClnFlag(tp)
tp.AddFlag(expr.GetType().GetFlag() & mysql.UnsignedFlag)

if expr.GetType().GetType() == mysql.TypeNull {
tp.SetType(mysql.TypeLong)
tp.AddFlag(mysql.UnsignedFlag)
}
return BuildCastFunction(ctx, expr, tp)
}

Expand Down
7 changes: 7 additions & 0 deletions planner/core/rule_aggregation_push_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ func (a *aggregationPushDownSolver) aggPushDown(p LogicalPlan, opt *logicalOptim
newAggFuncsArgs = append(newAggFuncsArgs, newArgs)
}
}
for i, funcsArgs := range oldAggFuncsArgs {
for j := range funcsArgs {
if oldAggFuncsArgs[i][j].GetType().EvalType() != newAggFuncsArgs[i][j].GetType().EvalType() {
noSideEffects = false
}
}
}
if noSideEffects {
agg.GroupByItems = newGbyItems
for i, aggFunc := range agg.AggFuncs {
Expand Down

0 comments on commit 408c42e

Please sign in to comment.