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

null字段添加Nullable配置,否则同步mysql回报nil异常;增加bit类型go处理 #93

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

googlefan
Copy link

在同步mysql数据时候,发现当字段可以为Null,并且数据是Null的时候,dm 数据同步报nil异常的异常

{"@timestamp":"2021-01-04T17:03:44.268+08","level":"error","content":"mysqltypeconv.go:59 sql: Scan error on column index 4, name "Default":
converting NULL to string is unsupported"}

通过如下代码可以解决

@icy4ever
Copy link
Contributor

这是个很好的建议,但是一些配置文件的改动是因为什么呢

@googlefan
Copy link
Author

googlefan commented May 22, 2022

这是个很好的建议,但是一些配置文件的改动是因为什么呢

上传多了好像,那些是我自己 用的配置,我应该只想推第一个commit 的4a237dc474065ead6a7a6fc8572d418a7136b5ce
已删除多余的提交

@org0000h
Copy link
Collaborator

这是个问题 但是Nullable类型可能会导致clickhouse 查询新能下降。

@googlefan
Copy link
Author

嗯是的,官方文档确实说了 不建议使用Nullable,但是这应该从源头数据做保证,或者说同步时候数据清洗一遍;
还有一个异常 稍后我再提一个,就是程序对Mysql bit 类型数据没有做特殊处理,导致异常,在string类型转换时 \x00 \x01会出错

@googlefan googlefan changed the title 如果字段类型可以为null 则添加 Nullable,否则同步mysql回报nil异常 null字段添加Nullable配置,否则同步mysql回报nil异常;增加bit类型go处理 May 25, 2022
@org0000h
Copy link
Collaborator

希望你能补充一些测试

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

Successfully merging this pull request may close these issues.

3 participants