Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
3.0.5
-
None
-
Spring-boot 2.7.1
Java 17
MariaDB 10.3.35
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:
- Launch the Mariadb service with this command:
docker-compose up -d - Launch the test:
./gradlew test
Expected result: The test is successful.
Actual result: The test fails because of a ConversionFailedException
Attachments
Issue Links
- is caused by
-
CONJ-987 Version 3.0.0 returns String for VARBINARY instead of byte[] as 2.7.6 did
- Closed