mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-26 00:07:01 +08:00
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
This commit is contained in:
@ -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
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user