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 8.0.15 和 canal 1.1.2 版本 同步数据总是error "Invalid charset id: 255" #1662

Closed
wade009 opened this issue Apr 4, 2019 · 5 comments

Comments

@wade009
Copy link

wade009 commented Apr 4, 2019

environment

  • canal version 1.1.2
  • mysql version 8.0.15

Issue Description

发现同步数据时总是提示:
Caused by: java.lang.IllegalArgumentException: Invalid charset id: 255
at com.taobao.tddl.dbsync.binlog.CharsetConversion.getEntry(CharsetConversion.java:41)
at com.taobao.tddl.dbsync.binlog.CharsetConversion.getJavaCharset(CharsetConversion.java:299)
at com.taobao.tddl.dbsync.binlog.event.QueryLogEvent.(QueryLogEvent.java:503)
at com.taobao.tddl.dbsync.binlog.LogDecoder.decode(LogDecoder.java:168)
at com.taobao.tddl.dbsync.binlog.LogDecoder.decode(LogDecoder.java:111)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$SimpleParserStage.onEvent(MysqlMultiStageCoprocessor.java:264)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$SimpleParserStage.onEvent(MysqlMultiStageCoprocessor.java:246)
at com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

查看com.taobao.tddl.dbsync.binlog.CharsetConversion类下的所有charsetId
范围是1~243对应mysql数据库的Collections表
254单独配置为utf-8

我尝试修改数据库,表和字段的charset的配置为utf-8,客户端连接配置也是utf-8
但是clientCharset = buffer.getUint16();依然返回255.
代码如下:
com.taobao.tddl.dbsync.binlog.event.QueryLogEvent.unpackVariables(line:630)
clientCharset = buffer.getUint16();

这是否是我的配置问题?

Steps to reproduce

Expected behaviour

Actual behaviour

@agapple
Copy link
Member

agapple commented Apr 4, 2019

升级1.1.3版本,已经解决

@agapple agapple closed this as completed Apr 4, 2019
@lanxinxu
Copy link
Contributor

lanxinxu commented May 28, 2019

有些情况下可能不适合直接升级,可以提供下改动的pr吗?我们可以参考一下 @agapple

@zhaolin81
Copy link

otter还未发布版本升级到1.1.3,尴尬

@agapple
Copy link
Member

agapple commented Jun 18, 2019

可以看CharsetUtil代码改动 @lanxinxu

@HugoSayHi
Copy link

HugoSayHi commented Nov 22, 2019

有些情况下可能不适合直接升级,可以提供下改动的pr吗?我们可以参考一下 @agapple

你好,请问你有解决这个问题吗? @lanxinxu

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

No branches or pull requests

5 participants