开发者社区> 问答> 正文

DDL解析失败 UNIQUE KEY `uid~date (uid,date`)

环境信息

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

展开
收起
云上静思 2023-05-04 12:01:25 89 0
1 条回答
写回答
取消 提交回答
  • 1.1.4 主干已经修复

    原回答者GitHub用户agapple

    2023-05-05 10:26:04
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
神龙云服务器产品及技术深度解析 立即下载
弹性创造价值:基于ECS的最佳性价比实践解析 立即下载
又快又稳:阿里云下一代虚拟交换机解析 立即下载

相关镜像