我知道dm支持 binlog-event-filter , 可以
filters:
rule-1:
schema-pattern: "test_*"
table-pattern: "t_*"
events: ["truncate table", "drop table"]
sql-pattern: ["^DROP\s+PROCEDURE", "^CREATE\s+PROCEDURE"]
action: Ignore
但是 在query-state报错如下
"msg": "[code=11006:class=functional:scope=internal:level=high] encountered incompatible DDL in TiDB:
please confirm your DDL statement is correct and needed.
for TiDB compatible DDL, please see the docs:
English version: https://pingcap.com/docs/dev/reference/mysql-compatibility/#ddl
Chinese version: https://pingcap.com/docs-cn/dev/reference/mysql-compatibility/#ddl
if the DDLis not needed, you can use a filter rule with "*" schema-pattern to ignore it.
: parse statement: line 4 column 15 near "PROCEDURE IF EXISTS `auto_create_schedule`" %!(EXTRA string=-- ----------------------------\r
-- Procedure structure for auto_create_schedule\r
-- ----------------------------\r
DROP PROCEDURE IF EXISTS `auto_create_schedule`)
github.com/pingcap/dm/pkg/terror.(*Error).Delegate
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/terror/terror.go:267
github.com/pingcap/dm/pkg/parser.Parse
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/pkg/parser/common.go:42
github.com/pingcap/dm/syncer.(*Syncer).parseDDLSQL
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/ddl.go:67
github.com/pingcap/dm/syncer.(*Syncer).handleQueryEvent
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:1483
github.com/pingcap/dm/syncer.(*Syncer).Run
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:1230
github.com/pingcap/dm/syncer.(*Syncer).Process
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:539
github.com/pingcap/dm/syncer.(*Syncer).Resume
/home/jenkins/workspace/build_dm_master/go/src/github.com/pingcap/dm/syncer/syncer.go:2188
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1337"
在worker的报错如下
[2019/08/29 08:27:54.786 +08:00] [ERROR] [common.go:35] ["parse statement"] [sql="-- ----------------------------\r
-- Procedure structure for auto_create_schedule\r
-- ----------------------------\r
DROP PROCEDURE IF EXISTS `auto_create_schedule`"] [error="line 4 column 15 near "PROCEDURE IF EXISTS `auto_create_schedule`" "]
[2019/08/29 08:27:54.786 +08:00] [ERROR] [ddl.go:70] ["encountered incompatible DDL in TiDB:
please confirm your DDL statement is correct and needed.
for TiDB compatible DDL, please see the docs:
English version: https://pingcap.com/docs/dev/reference/mysql-compatibility/#ddl
Chinese version: https://pingcap.com/docs-cn/dev/reference/mysql-compatibility/#ddl
if the DDL is not needed, you can use a filter rulewith "*" schema-pattern to ignore it.
"] [task=pre] [unit="binlog replication"] [sql="-- ----------------------------\r
-- Procedure structure for auto_create_schedule\r
-- ----------------------------\r
DROP PROCEDURE IF EXISTS `auto_create_schedule`"]
[2019/08/29 08:27:54.786 +08:00] [ERROR] [syncer.go:1485] ["fail to parse statement"] [task=pre] [unit="binlog replication"] [event=query] [statement="-- ----------------------------\r
-- Procedure structure for auto_create_schedule\r
-- ----------------------------\r
DROP PROCEDURE IF EXISTS `auto_create_schedule`"] [schema=slx] ["last position"="(mysql-bin|000001.000003, 203585670)"] [position="(mysql-bin|000001.000003, 203585946)"] ["gtid set"=NULL] [error="[code=11006:class=functional:scope=internal:level=high] encountered incompatible DDL in TiDB:
please confirm your DDL statement is correct and needed.
for TiDB compatible DDL, please see the docs:
English version: https://pingcap.com/docs/dev/reference/mysql-compatibility/#ddl
Chinese version: https://pingcap.com/docs-cn/dev/reference/mysql-compatibility/#ddl
if the DDL is not needed, you can use a filter rule with "*" schema-pattern to ignore it.
: parse statement: line 4 column 15 near "PROCEDURE IF EXISTS `auto_create_schedule`" %!(EXTRA string=-- ----------------------------\r
-- Procedure structure for auto_create_schedule\r
-- ----------------------------\r
DROP PROCEDURE IF EXISTS `auto_create_schedule`)"]
虽然可以改正则,但是按照官方的兼容性列表,要加很多正则条件才行。 能否直接增加一个skipError的开关参数?