Skip to content

Commit

Permalink
expression: handle ErrTruncated when dividing decimals in non-data-ch…
Browse files Browse the repository at this point in the history
…ange stmts (pingcap#14438)
  • Loading branch information
qw4990 committed Apr 13, 2020
1 parent 114ad7e commit e695cf8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions expression/builtin_arithmetic.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ func (s *builtinArithmeticDivideDecimalSig) evalDecimal(row chunk.Row) (*types.M
} else if err == types.ErrTruncated {
sc := s.ctx.GetSessionVars().StmtCtx
err = sc.HandleTruncate(errTruncatedWrongValue.GenWithStackByArgs("DECIMAL", c))
} else if err == types.ErrTruncated {
sc := s.ctx.GetSessionVars().StmtCtx
err = sc.HandleTruncate(errTruncatedWrongValue.GenWithStackByArgs("DECIMAL", c))
} else if err == nil {
_, frac := c.PrecisionAndFrac()
if frac < s.baseBuiltinFunc.tp.Decimal {
Expand Down

0 comments on commit e695cf8

Please sign in to comment.