1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-26 12:21:12 +03:00

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
This commit is contained in:
John Naylor
2021-07-30 13:50:23 -04:00
parent 02ef4d1e24
commit c7181a32c5
6 changed files with 38 additions and 9 deletions

View File

@ -8618,7 +8618,7 @@ int dectoint(decimal *np, int *ip);
Note that the ECPG implementation differs from the <productname>Informix</productname>
implementation. <productname>Informix</productname> limits an integer to the range from -32767 to
32767, while the limits in the ECPG implementation depend on the
architecture (<literal>-INT_MAX .. INT_MAX</literal>).
architecture (<literal>INT_MIN .. INT_MAX</literal>).
</para>
</listitem>
</varlistentry>