diff options
author | Dean Rasheed <dean.a.rasheed@gmail.com> | 2021-07-10 12:45:00 +0100 |
---|---|---|
committer | Dean Rasheed <dean.a.rasheed@gmail.com> | 2021-07-10 12:45:00 +0100 |
commit | 06883d58ff29cf4fb8c32fd13ce9947796b9fb0f (patch) | |
tree | 6b2a4f01a947e9482690f66417fe5ce21e164707 /src/test/regress/sql/numeric.sql | |
parent | 9ffad7ae7ffc632ff8d3822916c431b7e4a4df38 (diff) |
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
Diffstat (limited to 'src/test/regress/sql/numeric.sql')
-rw-r--r-- | src/test/regress/sql/numeric.sql | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/test/regress/sql/numeric.sql b/src/test/regress/sql/numeric.sql index db812c813a3..2e7507639a9 100644 --- a/src/test/regress/sql/numeric.sql +++ b/src/test/regress/sql/numeric.sql @@ -1044,6 +1044,8 @@ select 4770999999999999999999999999999999999999999999999999999999999999999999999 select 4769999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999; +select trim_scale((0.1 - 2e-16383) * (0.1 - 3e-16383)); + -- -- Test some corner cases for division -- |