-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Canal '\n, \t' problem in mysql json type #3110
Comments
canal在把Json格式的数据发向下游message的时候,没有对数据进行json-string的相应转义。致使其发送的message(string类型)不是一个合法的json-string 这是一个合法的json string:
这不是一个合法的json string,(然而Canal在发送这种形式的message)
|
We encountered this issue too. Does anybody know how to fix it? |
@kk17 we solved it on our own by replacing all special characters in message by its corresponding escaped string. |
Do you do this before parsing the JSON data? |
Yes, sure, otherwise it isn't parsable. |
我看了最新的代码已经是对\n添加了转义,可以测试下最新的1.1.5 |
请问是哪里的代码?目前使用otter里面存在这个问题 |
environment
Issue Description
We got a problem with json type in mysql with '\\n, \\t'
Canal will parse them '\\n, \\t' to ''\n, \t''. which is different with the content in mysql
我们发现canal 会把 mysql的 json type 里的 '\\n, \\t' 转成 '\n, \t'
这样会导致数据不一致
Steps to reproduce
Expected behaviour
Actual behaviour
If there is an exception, please attach the exception trace:
The text was updated successfully, but these errors were encountered: