Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
  • Loading branch information
windtalker committed Sep 27, 2022
1 parent d818431 commit 4fae2bf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions expression/builtin_arithmetic.go
Expand Up @@ -117,13 +117,11 @@ func setFlenDecimal4RealOrDecimal(ctx sessionctx.Context, retTp *types.FieldType
retTp.SetFlen(types.UnspecifiedLength)
return
}
digitsInt := mathutil.Max(a.GetFlen()-a.GetDecimal(), b.GetFlen()-b.GetDecimal())
if isMultiply {
digitsInt = a.GetFlen() - a.GetDecimal() + b.GetFlen() - b.GetDecimal()
}
if isMultiply {
digitsInt := a.GetFlen() - a.GetDecimal() + b.GetFlen() - b.GetDecimal()
retTp.SetFlenUnderLimit(digitsInt + retTp.GetDecimal())
} else {
digitsInt := mathutil.Max(a.GetFlen()-a.GetDecimal(), b.GetFlen()-b.GetDecimal())
retTp.SetFlenUnderLimit(digitsInt + retTp.GetDecimal() + 1)
}
if isReal {
Expand Down

0 comments on commit 4fae2bf

Please sign in to comment.