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
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/f051b87ace6dda42c191b77858c8d099af0de46a
Modified Files
--------------
doc/src/sgml/ecpg.sgml | 2 +-
src/interfaces/ecpg/pgtypeslib/numeric.c | 7 ++++++-
.../ecpg/test/expected/pgtypeslib-num_test.c | 21 ++++++++++++++++-----
.../ecpg/test/expected/pgtypeslib-num_test.stderr | 2 +-
.../ecpg/test/expected/pgtypeslib-num_test.stdout | 2 ++
src/interfaces/ecpg/test/pgtypeslib/num_test.pgc | 13 ++++++++++++-
6 files changed, 38 insertions(+), 9 deletions(-)