-
Notifications
You must be signed in to change notification settings - Fork 132
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
MySQL dialect converts all byte
properties to boolean
#589
Comments
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem. |
Thank you for your response. Please look at this minimal sample. These are scripts to create a sample database and table
When hitting "/user/add" I got the response with a state value is 3 but the actual value saved in the database is 1. |
byte
properties to boolean
…iaDB. ByteToBooleanConverter is now marked as reading converter and we've added a writing converter with BooleanToByteConverter to ensure proper conversion. Previously, all byte values were converted to boolean resulting in data precision loss. Closes #589
…iaDB. ByteToBooleanConverter is now marked as reading converter and we've added a writing converter with BooleanToByteConverter to ensure proper conversion. Previously, all byte values were converted to boolean resulting in data precision loss. Closes #589
Thanks for the report and the example. The |
I found that spring-data-r2dbc can read tinyint field as Byte type but I got 0 or 1 for tinyint fields in mysql/maridb database when inserting data.
It seems like byte field is converted to Boolean because of ByteToBooleanConverter in MySqlDialect class.
The text was updated successfully, but these errors were encountered: