Fix numeric_mul() overflow due to too many digits after decimal point.
authorDean Rasheed
Sat, 10 Jul 2021 11:45:00 +0000 (12:45 +0100)
committerDean Rasheed
Sat, 10 Jul 2021 11:45:00 +0000 (12:45 +0100)
commit06883d58ff29cf4fb8c32fd13ce9947796b9fb0f
tree6b2a4f01a947e9482690f66417fe5ce21e164707
parent9ffad7ae7ffc632ff8d3822916c431b7e4a4df38
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