环境信息
canal version: 1.1.3 mysql version: 5.7.18
问题描述
数据库DDL解析失败,具体语句
CREATE TABLE sign_detail
( id
int(10) NOT NULL AUTO_INCREMENT, uid
int(10) DEFAULT NULL COMMENT '签到人', month
varchar(10) DEFAULT NULL COMMENT '签到月份', date
date DEFAULT NULL COMMENT '签到日期', create_time
datetime DEFAULT NULL, PRIMARY KEY (id
), UNIQUE KEY uid``~``date
(uid
,date
) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
现执行情况
2019-07-08 11:45:32.833 [destination = xxx , address = /xxx.xxx.xxx.xxx:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta - parse faield : CREATE TABLE sign_detail
( id
int(10) NOT NULL AUTO_INCREMENT, uid
int(10) DEFAULT NULL COMMENT '签到人', month
varchar(10) DEFAULT NULL COMMENT '签到月份', date
date DEFAULT NULL COMMENT '签到日期', create_time
datetime DEFAULT NULL, PRIMARY KEY (id
), UNIQUE KEY uid``~``date
(uid
,date
) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 com.alibaba.fastsql.sql.parser.ParserException: syntax error, expect (, actual IDENTIFIER pos 328, line 8, column 17, token IDENTIFIER uid
at com.alibaba.fastsql.sql.parser.SQLExprParser.accept(SQLExprParser.java:3625) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.parser.SQLExprParser.parseIndexRest(SQLExprParser.java:4795) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlExprParser.parseUnique(MySqlExprParser.java:977) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlCreateTableParser.parseConstraint(MySqlCreateTableParser.java:1585) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlCreateTableParser.parseCreateTable(MySqlCreateTableParser.java:293) ~[fastsql-2.0.0_preview_855.jar:2.0.0_preview_855] at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:276) ~[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_191]
原提问者GitHub用户polegek
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。