Skip to content

Commit

Permalink
update formate
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhedu committed Sep 8, 2020
1 parent e8fec4c commit 9c3f2f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions expression/scalar_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,16 @@ func newFunctionImpl(ctx sessionctx.Context, fold int, funcName string, retType
if fold == 1 {
return FoldConstant(sf), nil
} else if fold == -1 {
// try to fold constants, and return the original if errors/warnings occur
// try to fold constants, and return the original function if errors/warnings occur
sc := ctx.GetSessionVars().StmtCtx
beforeWarns := sc.WarningCount()
newSf := FoldConstant(sf)
afterWarns := sc.WarningCount()
if afterWarns > beforeWarns {
sc.TruncateWarnings(int(beforeWarns))
return sf, nil
} else {
return newSf, nil
}
return newSf, nil
}
return sf, nil
}
Expand Down

0 comments on commit 9c3f2f5

Please sign in to comment.