Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.3
-
None
-
Linux
Description
Calling ResultSet.getLong on a column that contains a value larger than Long.MAX_VALUE should fail. Instead it wraps around to Long.MIN_VALUE.
The attached test case prints:
MySQL
8.0.27
MariaDB Connector/J
3.0.3
SUM = 9223372036854775807
SUM = -9223372036854775808
The second fetch should fail with some exception.
Replacing getLong by getInt and Long.MAX_VALUE by Integer.MAX_VALUE shows correct behaviour: the second fetch fails with "java.sql.SQLDataException: integer overflow".
This problem was not yet present in version 2.7.5.