From 9c3f2f5c5d8673933dfcf9cee1dc37b47a69d554 Mon Sep 17 00:00:00 2001 From: fzhedu Date: Tue, 8 Sep 2020 12:23:33 +0800 Subject: [PATCH] update formate --- expression/scalar_function.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/expression/scalar_function.go b/expression/scalar_function.go index 1cc437b2ce6a4..cd095bddf0b7b 100755 --- a/expression/scalar_function.go +++ b/expression/scalar_function.go @@ -213,7 +213,7 @@ 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) @@ -221,9 +221,8 @@ func newFunctionImpl(ctx sessionctx.Context, fold int, funcName string, retType if afterWarns > beforeWarns { sc.TruncateWarnings(int(beforeWarns)) return sf, nil - } else { - return newSf, nil } + return newSf, nil } return sf, nil }