[CONJ-993] SQLDataException reading DATA_TYPE on DatabaseMetaData.getTypeInfo() after 3.0.4 Created: 2022-07-12  Updated: 2022-07-25  Resolved: 2022-07-25

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC compatibility
Affects Version/s: 3.0.4, 3.0.5, 3.0.6
Fix Version/s: 3.0.7

Type: Bug Priority: Critical
Reporter: Lucas Collares Favaron Galvao Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows 10, jdk 17.0.3, connecting to MySQL 8.0.29 and MariaDb 10.8.3



 Description   

There was a change from version 3.0.3 ->3.0.4, that broke our usage of the MariaDb connector. The change was related to CONJ-923, and specifically the changes to IntCodec.java on the commit c999c2ec1d396d947bc30515aefed00e65937c18.

What is happening is, while reading the database metadata, specifically reading the resultset of DatabaseMetaData.getTypeInfo(), for the row with TYPE_NAME = "BIT", we are getting a SQLDataException for "int overflow" when we try to get ResultSet.getInt("DATA_TYPE"), which the value is -7 but it seems that it's flagged as an unsigned integer, honesty I'm not sure if throwing this exception was intended for this cenario.

We use this same class for reading different databases metadata, including mariaDb and MySQL, and never had a problem before version 3.0.4, where a validation in IntCodec, previously only done for BIGINT column types was moved out of the switch case.

So I would like to check if this change was intended.



 Comments   
Comment by Diego Dupin [ 2022-07-25 ]

Indeed, CONJ-923 correction has an unintended effect for DatabaseMetaData.getTypeInfo() results.
This will be corrected in next corrective version

Comment by Lucas Collares Favaron Galvao [ 2022-07-25 ]

Thanks for the update Diego, we stuck to the 2.7.X versions, and we'll reavaluate the update to 3.X later.

Thanks for the work you guys do.

Comment by Diego Dupin [ 2022-07-25 ]

happy to please

Generated at Thu Feb 08 03:19:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.