forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit258b770
committed
Fix numeric_power() when the exponent is INT_MIN.
In power_var_int(), the computation of the number of significantdigits to use in the computation used log(Abs(exp)), which isn't safebecause Abs(exp) returns INT_MIN when exp is INT_MIN. Use fabs()instead of Abs(), so that the exponent is cast to a double before theabsolute value is taken.Back-patch to 9.6, where this was introduced (by7d9a473).Discussion:https://postgr.es/m/CAEZATCVd6pMkz=BrZEgBKyqqJrt2xghr=fNc8+Z=5xC6cgWrWA@mail.gmail.com1 parent7c98759 commit258b770
File tree
3 files changed
+8
-1
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8601 | 8601 | | |
8602 | 8602 | | |
8603 | 8603 | | |
8604 | | - | |
| 8604 | + | |
8605 | 8605 | | |
8606 | 8606 | | |
8607 | 8607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1626 | 1632 | | |
1627 | 1633 | | |
1628 | 1634 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| |||
0 commit comments
Comments
(0)