We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
tinyint(1)
0
1
true
false
这是因为 MySQL 会把 tinyint(1) 自动转为 bit 导致的。
bit
参考:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html
只需在 MySQL 连接地址上加一个 tinyInt1isBit=false 参数即可,例如:
tinyInt1isBit=false
spring.datasource.url = jdbc:mysql://xxx/demo?tinyInt1isBit=false
The text was updated successfully, but these errors were encountered:
或者,字段类型不要定义成 tinyint(1),直接定义成 tinyint
tinyint
Sorry, something went wrong.
No branches or pull requests
原因
这是因为 MySQL 会把
tinyint(1)
自动转为bit
导致的。参考:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html
解决方案
只需在 MySQL 连接地址上加一个
tinyInt1isBit=false
参数即可,例如:The text was updated successfully, but these errors were encountered: