环境信息
centos, jdk8
canal version canal 1.1.3 mysql version mysql 5.6
问题描述
parse tsdb的创建数据库语句报错。 2019-06-13 16:18:59.318 [destination = example , address = /Ip:port , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta - parse faield : CREATE DATABASE /!32312 IF NOT EXISTS/db_name /*!40100 DEFAULT CHARACTER SET utf8mb4 */ com.alibaba.fastsql.sql.parser.ParserException: illegal name, pos 40, line 1, column 17, token HINT at com.alibaba.fastsql.sql.parser.SQLExprParser.name(SQLExprParser.java:1812) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreateDatabase(MySqlStatementParser.java:6543) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:292) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:228) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.SQLUtils.parseStatements(SQLUtils.java:536) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.repository.SchemaRepository.console(SchemaRepository.java:439) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta.apply(MemoryTableMeta.java:81) ~[canal.parse-1.1.3.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.applyHistoryOnMemory(DatabaseTableMeta.java:463) [canal.parse-1.1.3.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.rollback(DatabaseTableMeta.java:174) [canal.parse-1.1.3.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser.processTableMeta(AbstractMysqlEventParser.java:106) [canal.parse-1.1.3.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:192) [canal.parse-1.1.3.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_192]
步骤重现
创建数据库的语句带hint。 CREATE DATABASE /!32312 IF NOT EXISTS/db_name /*!40100 DEFAULT CHARACTER SET utf8mb4 */ 导致无法处理,实际的instance启动失败。 处理方式是把tsdb里面的语句给改写了,才过去了,这是不是修复下?
原提问者GitHub用户Roronoa-Zoro
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。