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

MySQL驱动包支持Boolean类型,canal不支持boolean类型转换 #631

Closed
kervin521 opened this issue May 8, 2018 · 6 comments
Closed
Labels
Milestone

Comments

@kervin521
Copy link

MySQL的驱动包中对tinyint的长度为1,对应sqlType=-7,转化为Java布尔类型,参考MySQL驱动源码

image

而Canal对对tinyint的长度为1,对应sqlType=-6,无法处理为Java的布尔类型

@kervin521 kervin521 changed the title canal不支持boolean类型转换 MySQL驱动包支持Boolean类型,canal不支持boolean类型转换 May 8, 2018
@agapple
Copy link
Member

agapple commented May 10, 2018

没有专门针对tinyint(1)做过特殊处理,目前统一按照了tinyint类型-6

@kervin521
Copy link
Author

有计划支持吗?

@agapple
Copy link
Member

agapple commented May 15, 2018

可以考虑提交一个PR给我

nbqyqx added a commit to nbqyqx/canal that referenced this issue Jun 7, 2018
@nbqyqx
Copy link
Contributor

nbqyqx commented Jun 7, 2018

#682

@nbqyqx
Copy link
Contributor

nbqyqx commented Jun 7, 2018

@agapple please assign the issue to me :)

@agapple agapple closed this as completed in cc8d5b4 Jun 8, 2018
@agapple agapple added the bug label Jun 8, 2018
@agapple agapple added this to the v1.0.26 milestone Jun 8, 2018
@KaimingWan
Copy link
Collaborator

The fix still have some problem when sync data with tinyint(1) type. If not specify tinyInt1isBit in your jdbc url,the return java type is integer. Reference doc is https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html

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

No branches or pull requests

4 participants