[CONJ-989] Binary column read as String Created: 2022-07-07 Updated: 2022-07-20 Resolved: 2022-07-20 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | MySQL compatibility |
| Affects Version/s: | 3.0.5 |
| Fix Version/s: | 3.0.7 |
| Type: | Bug | Priority: | Major |
| Reporter: | Loic Tosser | Assignee: | Diego Dupin |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Spring-boot 2.7.1 |
||
| Issue Links: |
|
||||||||
| Description |
|
We have an issue with a byte array stored in a BINARY column. We store a UUID in a BINARY(16) column. We convert the UUID to a byte[] before writing. We convert back from byte[] to UUID when reading. We migrated from Spring-boot 2.6.8 to Spring-boot 2.7.1. The new 2.7.1 version comes with mariadb-java-connector:3.0.5 (with Spring-boot 2.6.X it was the 2.7.X versions). With this new version, we have a NumberFormatException thrown when reading UUIDs from the DBs. The UUID is correctly stored as byte[], but read as String in the JDBC ResultSet. How to reproduce I created a repository to reproduce the issue. This repository contains a simple Entity, EntityWithUuid. There is a Spring Data JDBC repository, EntityWithUuidRepository and its related test, EntityWithUudRepositoryTest. To reproduce the issue:
Expected result: The test is successful. Actual result: The test fails because of a ConversionFailedException |