Commit e15c384
committed
Fix numeric_power() when the exponent is INT_MIN.
In power_var_int(), the computation of the number of significant
digits to use in the computation used log(Abs(exp)), which isn't safe
because 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 the
absolute value is taken.
Back-patch to 9.6, where this was introduced (by 7d9a473).
Discussion: https://postgr.es/m/CAEZATCVd6pMkz=BrZEgBKyqqJrt2xghr=fNc8+Z=5xC6cgWrWA@mail.gmail.com1 parent 9e7d87c commit e15c384
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 | |
|---|---|---|---|
| |||
9370 | 9370 | | |
9371 | 9371 | | |
9372 | 9372 | | |
9373 | | - | |
| 9373 | + | |
9374 | 9374 | | |
9375 | 9375 | | |
9376 | 9376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1674 | 1674 | | |
1675 | 1675 | | |
1676 | 1676 | | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1677 | 1683 | | |
1678 | 1684 | | |
1679 | 1685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
| 912 | + | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
| |||
0 commit comments