[CONJ-922] DECIMAL overflow for long/int/short not throwing exception Created: 2022-02-01 Updated: 2022-02-10 Resolved: 2022-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 3.0.3 |
| Fix Version/s: | 3.0.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Ralf Wiebicke | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Attachments: |
|
| 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 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. |
| Comments |
| Comment by Diego Dupin [ 2022-02-10 ] | ||||||||||||||||
|
corrected with commit https://github.com/mariadb-corporation/mariadb-connector-j/commit/a180c21f4fd870d3c64b7301c4e4cdb8c86d0659 overflow was not handled for DECIMAL value for short/int/long. correction is available though snapshot:
|