Commit bc43b7c
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 5a3574d commit bc43b7c
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 | |
|---|---|---|---|
| |||
10290 | 10290 | | |
10291 | 10291 | | |
10292 | 10292 | | |
10293 | | - | |
| 10293 | + | |
10294 | 10294 | | |
10295 | 10295 | | |
10296 | 10296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
2324 | 2330 | | |
2325 | 2331 | | |
2326 | 2332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1089 | 1089 | | |
1090 | 1090 | | |
1091 | 1091 | | |
| 1092 | + | |
1092 | 1093 | | |
1093 | 1094 | | |
1094 | 1095 | | |
| |||
0 commit comments