Bug #82032 ResultSet#getLong returns wrong result instead of raising an exception
Submitted: 28 Jun 2016 11:40 Modified: 19 Jan 2022 12:26
Reporter: Ralf Wiebicke Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.1.45 OS:Any
Assigned to: CPU Architecture:Any

[28 Jun 2016 11:40] Ralf Wiebicke
Description:
When I do ResultSet#getLong for something that evaluates to a value larger than Long.MAX_VALUE, an exception should be raised. The MySQL Connector returns Long.MAX_VALUE instead.

This is not a server issue, When accessing the same database server via MariaDB JDBC driver, correctly an exception is raised.

How to repeat:
I will attached a test case.
[28 Jun 2016 11:41] Ralf Wiebicke
Test case

Attachment: OverflowLongSumTest.java (text/x-java), 1.66 KiB.

[30 Jun 2016 6:32] Chiranjeevi Battula
Hello Ralf Wiebicke,

Thank you for the bug report and test case.
Verified based on internal discussion with dev's.

Thanks,
Chiranjeevi.
[5 Jan 2018 7:52] Ralf Wiebicke
The problem is resolved in versions 6.0.6 and 8.0.8-dmr, but not in 5.1.45
[6 Sep 2019 13:37] Alexander Soklakov
Bug#96493 is marked as a duplicate of this one, please check additional cases there.
[19 Jan 2022 12:26] Alexander Soklakov
Posted by developer:
 
This bug is not reproducible with the latest Connector/J 8.0.

Connector/J 5.1 series came to EOL on Feb 9th, 2021, see https://www.mysql.com/support/eol-notice.html, so this bug will not be fixed there.