pgsql: Fix numeric_mul() overflow due to too many digits after decimal - Mailing list pgsql-committers

From Dean Rasheed
Subject pgsql: Fix numeric_mul() overflow due to too many digits after decimal
Date
Msg-id E1m2BYl-0007cJ-BI@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f23a9b8a49af1ef89dd65399867ca21318ae6b8e

Modified Files
--------------
src/backend/utils/adt/numeric.c       | 10 +++++++++-
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  2 ++
3 files changed, 17 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Un-break AIX build, take 2.
Next
From: Michael Paquier
Date:
Subject: pgsql: Add more sanity checks in SASL exchanges