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

canal解析DDL语句报错 #5304

Open
wangcool opened this issue Oct 24, 2024 · 1 comment
Open

canal解析DDL语句报错 #5304

wangcool opened this issue Oct 24, 2024 · 1 comment

Comments

@wangcool
Copy link

canal 版本:1.1.4
mysql版本:5.7.28

Question

2024-10-23 10:50:10.788 [destination = shuzi-binlog , address = /11.28.20.200:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta - parse faield : /* Create table in target */
CREATE TABLE loan_debt(
ORDER_NO varchar(19) COLLATE utf8_general_ci NOT NULL COMMENT '借据号' ,
CUST_NO varchar(19) COLLATE utf8_general_ci NOT NULL COMMENT '客户号' ,
PROD_SUB_NO varchar(6) COLLATE utf8_general_ci NOT NULL COMMENT '产品号' ,
CAPITAL_SOURCE varchar(10) COLLATE utf8_general_ci NOT NULL COMMENT '来源' ,
PACKAGE_DATE int(8) NOT NULL DEFAULT '0' COMMENT '封包日期' ,
DEBT_DATE int(8) NOT NULL DEFAULT '0' COMMENT '债转日期' ,
ACCOUNT_TREATMENT_STATUS char(1) COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '是否账务处理,1-是;0-否,默认否' ,
ACCOUNT_TREATMENT_DATE int(8) NOT NULL DEFAULT '0' COMMENT '账务处理日期' ,
BD_CREATE_DATETIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,
BD_UPDATE_DATETIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '更新时间' ,
DW_ID bigint(20) unsigned NOT NULL auto_increment COMMENT '自增id' ,
DW_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '时间戳' ,
IS_DELETE tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '数据逻辑删除字段' ,
PROMPT_DATE int(8) NULL COMMENT '交割日期' ,
PRIMARY KEY (ORDER_NO) ,
UNIQUE KEY DW_ID_UNIQUE(DW_ID) ,
KEY IDX_ACCOUNT_TREATMENT_DATE(ACCOUNT_TREATMENT_DATE)
) ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='借据表'
com.alibaba.fastsql.sql.parser.ParserException: syntax error, error in :'TAMP on update CURRENT_TIMESTAMP CO', expect ), actual ON, pos 871, line 12, column 99, token ON
at com.alibaba.fastsql.sql.parser.SQLParser.printError(SQLParser.java:430) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.parser.SQLParser.accept(SQLParser.java:438) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlCreateTableParser.parseCreateTable(MySqlCreateTableParser.java:358) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.dialect.mysql.parser.MySqlStatementParser.parseCreate(MySqlStatementParser.java:291) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:231) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.SQLUtils.parseStatements(SQLUtils.java:536) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.fastsql.sql.repository.SchemaRepository.console(SchemaRepository.java:439) ~[fastsql-2.0.0_preview_973.jar:2.0.0_preview_973]
at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.MemoryTableMeta.apply(MemoryTableMeta.java:83) ~[canal.parse-1.1.4.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.applyHistoryOnMemory(DatabaseTableMeta.java:465) [canal.parse-1.1.4.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta.rollback(DatabaseTableMeta.java:176) [canal.parse-1.1.4.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.AbstractMysqlEventParser.processTableMeta(AbstractMysqlEventParser.java:137) [canal.parse-1.1.4.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:200) [canal.parse-1.1.4.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_242]
2024-10-23 10:50:10.788 [destination = shuzi-binlog , address = /11.28.20.200:3306 , EventParser] WARN c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - ---> find start position successfully, EntryPosition[included=false,journalName=3306-binlog.000328,position=41492,serverId=125,gtid=,timestamp=1729651782000] cost : 105ms , the next step is binlog dump
2024-10-23 10:51:31.225 [canal-instance-scan-0] INFO c.a.otter.canal.instance.core.AbstractCanalInstance - stop CannalInstance for null-shuzi-binlog
2024-10-23 10:51:31.461 [canal-instance-scan-0] INFO c.a.otter.canal.instance.core.AbstractCanalInstance - stop successful....

@dyrnq
Copy link

dyrnq commented Oct 24, 2024

CREATE TABLE loan_debt(
ORDER_NO varchar(19) COLLATE utf8_general_ci NOT NULL COMMENT '借据号' ,
CUST_NO varchar(19) COLLATE utf8_general_ci NOT NULL COMMENT '客户号' ,
PROD_SUB_NO varchar(6) COLLATE utf8_general_ci NOT NULL COMMENT '产品号' ,
CAPITAL_SOURCE varchar(10) COLLATE utf8_general_ci NOT NULL COMMENT '来源' ,
PACKAGE_DATE int(8) NOT NULL DEFAULT '0' COMMENT '封包日期' ,
DEBT_DATE int(8) NOT NULL DEFAULT '0' COMMENT '债转日期' ,
ACCOUNT_TREATMENT_STATUS char(1) COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '是否账务处理,1-是;0-否,默认否' ,
ACCOUNT_TREATMENT_DATE int(8) NOT NULL DEFAULT '0' COMMENT '账务处理日期' ,
BD_CREATE_DATETIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间' ,
BD_UPDATE_DATETIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '更新时间' ,
DW_ID bigint(20) unsigned NOT NULL auto_increment COMMENT '自增id' ,
DW_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP COMMENT '时间戳' ,
IS_DELETE tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '数据逻辑删除字段' ,
PROMPT_DATE int(8) NULL COMMENT '交割日期' ,
PRIMARY KEY (ORDER_NO) ,
UNIQUE KEY DW_ID_UNIQUE(DW_ID) ,
KEY IDX_ACCOUNT_TREATMENT_DATE(ACCOUNT_TREATMENT_DATE)
) ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='借据表'

看下你的这个语句 BD_UPDATE_DATETIME 和 DW_TIME 两列的分别各自有两个on update,是不是重复了?

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

2 participants