Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.0.3
-
Fix Version/s: 3.0.4
-
Component/s: Other
-
Labels:None
-
Environment: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.