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:
@ -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>
|
||||
|
Reference in New Issue
Block a user