Describe the issue
Calling ResultSet.getInt() on a column that contains the double precision ("float8") value 2.0 fails with an exception due to a copy-paste error in #2719
The constant LONG_MAX_VALUE is incorrectly derived from Long.MIN_VALUE, which breaks the bounds check during conversion: https://github.com/pgjdbc/pgjdbc/pull/2719/files#diff-7e93771092eab9084402e3c7c81319a1f037febdc7614264329bd29f11d39ef2R3380
Driver Version?
42.5.2
Java Version?
17
OS Version?
Pop!_OS 22.04 LTS
PostgreSQL Version?
14.6
To Reproduce
Steps to reproduce the behaviour:
- return
2.0 :: double precision from any query and try to call ResultSet.getInt() on the corresponding column
Expected behaviour
Describe the issue
Calling ResultSet.getInt() on a column that contains the double precision ("float8") value 2.0 fails with an exception due to a copy-paste error in #2719
The constant
LONG_MAX_VALUEis incorrectly derived fromLong.MIN_VALUE, which breaks the bounds check during conversion: https://github.com/pgjdbc/pgjdbc/pull/2719/files#diff-7e93771092eab9084402e3c7c81319a1f037febdc7614264329bd29f11d39ef2R3380Driver Version?
42.5.2
Java Version?
17
OS Version?
Pop!_OS 22.04 LTS
PostgreSQL Version?
14.6
To Reproduce
Steps to reproduce the behaviour:
2.0 :: double precisionfrom any query and try to callResultSet.getInt()on the corresponding columnExpected behaviour