Fix numeric_mul() overflow due to too many digits after decimal point.
authorDean Rasheed <dean.a.rasheed@gmail.com>
Sat, 10 Jul 2021 11:46:13 +0000 (12:46 +0100)
committerDean Rasheed <dean.a.rasheed@gmail.com>
Sat, 10 Jul 2021 11:46:13 +0000 (12:46 +0100)
commitf23a9b8a49af1ef89dd65399867ca21318ae6b8e
tree41ec85c8a07112630a38226ed085d5cd3287a5b3
parent32d0bdbfcf2f1f024f24797eda14a250c13fa62e
Fix numeric_mul() overflow due to too many digits after decimal point.

This fixes an overflow error when using the numeric * operator if the
result has more than 16383 digits after the decimal point by rounding
the result. Overflow errors should only occur if the result has too
many digits *before* the decimal point.

Discussion: https://postgr.es/m/CAEZATCUmeFWCrq2dNzZpRj5+6LfN85jYiDoqm+ucSXhb9U2TbA@mail.gmail.com
src/backend/utils/adt/numeric.c
src/test/regress/expected/numeric.out
src/test/regress/sql/numeric.sql