]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix range check in ECPG numeric to int conversion
authorJohn Naylor <john.naylor@postgresql.org>
Fri, 30 Jul 2021 17:50:23 +0000 (13:50 -0400)
committerJohn Naylor <john.naylor@postgresql.org>
Fri, 30 Jul 2021 19:59:10 +0000 (15:59 -0400)
commitd9589eb62a2b4bb43a7893b0bb1acd6eb1bdfe9b
treea16cd421a276c2bfef9f5629e3dda46e7db1129f
parentd7ded08e6e0e565adf6fea7c55bfcf2845e5f8cc
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
doc/src/sgml/ecpg.sgml
src/interfaces/ecpg/pgtypeslib/numeric.c
src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c
src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stderr
src/interfaces/ecpg/test/expected/pgtypeslib-num_test.stdout
src/interfaces/ecpg/test/pgtypeslib/num_test.pgc