Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlOperations doesn't properly support binary data #315

Open
dtwitty opened this issue May 7, 2024 · 1 comment
Open

SqlOperations doesn't properly support binary data #315

dtwitty opened this issue May 7, 2024 · 1 comment
Labels
Milestone

Comments

@dtwitty
Copy link

dtwitty commented May 7, 2024

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

  1. Set up a DB schema with a BINARY(16) column
  2. Make an update using SqlOperations.updateWithParams where one of the params is a byte[] of length 16 (this worked on Vert.x 3).
  3. Run the update
  4. The update query fails! MySQL complains that the incoming data doesn't fit in the column.

Extra

Using JVM 11.0.8-msft

@dtwitty dtwitty added the bug label May 7, 2024
@tsegismont tsegismont added this to the 4.5.9 milestone Jun 17, 2024
@vietj vietj modified the milestones: 4.5.9, 4.5.10 Jul 17, 2024
@vietj vietj modified the milestones: 4.5.10, 4.5.11 Sep 4, 2024
@dtwitty
Copy link
Author

dtwitty commented Sep 25, 2024

Hi there @vietj,

Any thoughts on how we could get around this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants