- 【TiDB 版本】:TiDB-v3.0.7
- 【问题描述】:
我用syncer,实现mysql到tidb集群的增量同步。今天在syncer里面报了个错误,说是DDL语句不兼容,可是我单独在tidb命令行里面执行这个ddl语句是可以执行的。
我想问,为什么syncer说不兼容,不让执行,而直接在tidb命令行里面能执行呢。
错误日志如下:
[root@pd-tidbserver syncer]# cat syncer.log
encountered incompatible DDL in TiDB: create table fine_user (id varchar(255) not null, birthday datetime, creationType integer not null, description varchar(1000), email varchar(255), enable bit, language varchar(255), lastOperationType integer not null, male bit, mobile varchar(255), password varchar(255) not null, realName varchar(255), userName varchar(255) not null, workPhone varchar(255), primary key (id))
please confirm your DDL statement is correct and needed.
for TiDB compatible DDL, please see the docs:
English version: https://github.com/pingcap/docs/blob/master/sql/ddl.md
Chinese version: https://github.com/pingcap/docs-cn/blob/master/sql/ddl.md
if the DDL is not needed, you can modify the meta file and restart syncer to skip it.
2019/12/19 11:09:08 syncer.go:748: [error] [error query event][schema]bi [error type]incompatible DDL [sql]create table fine_user (id varchar(255) not null, birthday datetime, creationType integer not null, description varchar(1000), email varchar(255), enable bit, language varchar(255), lastOperationType integer not null, male bit, mobile varchar(255), password varchar(255) not null, realName varchar(255), userName varchar(255) not null, workPhone varchar(255), primary key (id)) [error message]line 1 column 167 near “language varchar(255), lastOperationType integer not null, male bit, mobile varchar(255), password varchar(255) not null, realName varchar(255), userName varchar(255) not null, workPhone varchar(255), primary key (id))” [current pos](binglog.000017, 764132432) [next pos](binglog.000017, 764133550) [current gtid set] [next gtid set]
2019/12/19 11:09:08 syncer.go:1018: [info] flush all jobs meta = syncer-binlog = (binglog.000017, 764132432), syncer-binlog-gtid =
2019/12/19 11:09:08 meta.go:135: [info] save position to file, binlog-name:binglog.000017 binlog-pos:764132432 binlog-gtid:
2019/12/19 11:09:08 main.go:79: [error] /home/jenkins/agent/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/syncer/ddl.go:74: [error type]incompatible DDL [sql]create table fine_user (id varchar(255) not null, birthday datetime, creationType integer not null, description varchar(1000), email varchar(255), enable bit, language varchar(255), lastOperationType integer not null, male bit, mobile varchar(255), password varchar(255) not null, realName varchar(255), userName varchar(255) not null, workPhone varchar(255), primary key (id)) [error message]line 1 column 167 near “language varchar(255), lastOperationType integer not null, male bit, mobile varchar(255), password varchar(255) not null, realName varchar(255), userName varchar(255) not null, workPhone varchar(255), primary key (id))”
/home/jenkins/agent/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/syncer/syncer.go:749:
/home/jenkins/agent/workspace/build_tidb_enterprise_tools_master/go/src/github.com/pingcap/tidb-enterprise-tools/syncer/syncer.go:193:
2019/12/19 11:09:08 syncer.go:928: [info] print status exits, err:context canceled
我在tidb里面,是能执行这个语句的: