Fix range check in ECPG numeric to int conversion
John Naylor <john.naylor@postgresql.org>
Fix range check in ECPG numeric to int conversion The previous coding guarded against -INT_MAX instead of INT_MIN, leading to -2147483648 being rejected as out of range. Per bug #17128 from Kevin Sweet Discussion: https://www.postgresql.org/message-id/flat/17128-55a8a879727a3e3a%40postgresql.org Reviewed-by: Tom Lane Backpatch to all supported branches
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ecpg.sgml | modified | +1 −1 |
| src/interfaces/ecpg/pgtypeslib/numeric.c | modified | +6 −1 |
| src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c | modified | +16 −5 |
| src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stderr | modified | +1 −1 |
| src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stdout | modified | +2 −0 |
| src/interfaces/ecpg/test/pgtypeslib/num_test.pgc | modified | +12 −1 |
Documentation touched
Discussion
- BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented 6 messages · 2021-07-29 → 2021-07-30