`SqlOperations` doesn't properly support binary data
dtwitty opened this issue · 1 comments
dtwitty commented
Version
Version
vert.x core, jdbc-client: 4.5.7
RDBMS server : MySQL
Context
I am migrating my app from Vert.x 3.9.13 to 4.5.7. I have encountered a breaking change that is blocking me from completing the migration.
I noticed that when I upgraded Vert.x, my tests started complaining of data truncation reported by MySQL. MySQL was refusing to store by byte[]
of length 16 in a BINARY(16)
column.
I traced this to how parameters are passed to queries, which is by way of JsonArray
. JsonArray.getValue
calls JsonArray.wrapJsonValue
, which converts byte[]
into a Base64-string. This string is longer than 16 bytes, so MySQL refused to store it.
Do you have a reproducer?
No.
Steps to reproduce
- Set up a DB schema with a
BINARY(16)
column - Make an update using
SqlOperations.updateWithParams
where one of the params is abyte[]
of length 16 (this worked on Vert.x 3). - Run the update
- The update query fails! MySQL complains that the incoming data doesn't fit in the column.
Extra
Using JVM 11.0.8-msft