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 varchar类型处理'\000'字符问题 #17

Closed
agapple opened this issue Feb 26, 2013 · 0 comments
Closed

mysql varchar类型处理'\000'字符问题 #17

agapple opened this issue Feb 26, 2013 · 0 comments
Assignees
Labels
Milestone

Comments

@agapple
Copy link
Member

agapple commented Feb 26, 2013

线上测试遇到一个问题:
a. 业务执行sql插入了一条记录,其中一个字段为:'210012\000\000\000'
b. otter中美同步,更新了这条记录,将字段更新为: '210012' (去除了\000)
c. canal再一次解析时,发现before和after值相同,没有任何字段发生变更,导致otter同步sql执行失败。

原因分析:

  1. dbsync在解析'210012\000\000\000',等价于'210012',自动忽略了'\000'请求

代码:
for (; (found < end) && buf[found] != '\0'; found++)

说明: \0为c-style风格的字符串结束符,至于业务执行怎么插入了\000,目前暂未知原因

@ghost ghost assigned in355hz Feb 26, 2013
agapple pushed a commit that referenced this issue Nov 5, 2018
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

2 participants