You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A weird issue popped up after upgrading the MariaDB driver (org.mariadb.jdbc:mariadb-java-client) from 2.7.5 to 3.0.3.
A column with UUID type fails to properly decode the UUID after upgrading. A small example which is partially copied from our codebase:
object ClientTable : Table("client") {
val id = uuid("id").autoGenerate()
overrideval primaryKey =PrimaryKey(id)
}
transaction {
val id =UUID.fromString("d4ae5273-6cbd-4b0a-a032-b7c79834151e")
val client =ClientTable.select { ClientTable.id.eq(id) }.firstOrNull()
requireNotNull(client) { "Client not found" }
require(client[ClientTable.id] == id) { "${client[ClientTable.id]} != $id" }
}
The above sample fails with this exception:
Exception in thread "main" java.lang.IllegalArgumentException: d4ae5273-6cef-bfbd-4b0a-efbfbd32efbf != d4ae5273-6cbd-4b0a-a032-b7c79834151e
As you can see, the id (which should be d4ae5273-6cbd-4b0a-a032-b7c79834151e) changed to a different value (d4ae5273-6cef-bfbd-4b0a-efbfbd32efbf). Looking at the database values in the database explorer within IntelliJ shows the correct UUID. Looking at this, I assume that encoding/serializing the UUID works fine, but decoding/deserializing the data from the database is somehow broken.
edit: The issue also happens for 3.0.0-alpha, 3.0.1-beta and 3.0.2-rc.
The text was updated successfully, but these errors were encountered:
I have exactly the same problem.
Testing was done with Exposed 3.0.3 and a basic mariadb docker container.
This also happens when using a "UUIDTable".
Edit: I've also tried a postgres database and as that one has an uuid type build-in there is no such error.
I guess its related to the encoding/decoding in sql/ColumnType as @nielsvanvelzen mentioned.
A weird issue popped up after upgrading the MariaDB driver (
org.mariadb.jdbc:mariadb-java-client
) from 2.7.5 to 3.0.3.A column with UUID type fails to properly decode the UUID after upgrading. A small example which is partially copied from our codebase:
The above sample fails with this exception:
As you can see, the id (which should be
d4ae5273-6cbd-4b0a-a032-b7c79834151e
) changed to a different value (d4ae5273-6cef-bfbd-4b0a-efbfbd32efbf
). Looking at the database values in the database explorer within IntelliJ shows the correct UUID. Looking at this, I assume that encoding/serializing the UUID works fine, but decoding/deserializing the data from the database is somehow broken.edit: The issue also happens for 3.0.0-alpha, 3.0.1-beta and 3.0.2-rc.
The text was updated successfully, but these errors were encountered: