From 9cbe564919a0b34c52c37c5d3ee0ca99d41c0e6f Mon Sep 17 00:00:00 2001 From: liumengya94 <1827915285@qq.com> Date: Mon, 6 Feb 2023 16:06:07 +0800 Subject: [PATCH] fix delete --- dm/dm/ctl/master/source_table_schema.go | 2 +- dm/tests/sequence_sharding_optimistic/run.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dm/dm/ctl/master/source_table_schema.go b/dm/dm/ctl/master/source_table_schema.go index ee813a46105..6a41ddb741e 100644 --- a/dm/dm/ctl/master/source_table_schema.go +++ b/dm/dm/ctl/master/source_table_schema.go @@ -172,7 +172,7 @@ func newSourceTableSchemaDeleteCmd() *cobra.Command { database := args[1] table := args[2] request := &pb.OperateSchemaRequest{ - Op: pb.SchemaOp_SetSchema, + Op: pb.SchemaOp_RemoveSchema, Task: taskName, Sources: sources, Database: database, diff --git a/dm/tests/sequence_sharding_optimistic/run.sh b/dm/tests/sequence_sharding_optimistic/run.sh index 1129d8d03d6..0c5fe80acef 100755 --- a/dm/tests/sequence_sharding_optimistic/run.sh +++ b/dm/tests/sequence_sharding_optimistic/run.sh @@ -164,6 +164,10 @@ run() { "binlog-schema list -s mysql-replica-01,mysql-replica-02 sequence_sharding_optimistic sharding_seq_opt t2" \ "\"result\": true" 3 + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "binlog-schema delete -s mysql-replica-01 sequence_sharding_optimistic sharding_seq_opt t2" \ + "\"result\": true" 2 + # try to set another schema, `c3` `int` -> `bigint`. echo 'CREATE TABLE `t1` ( `id` bigint(20) NOT NULL, `c2` varchar(20) DEFAULT NULL, `c3` bigint(11) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin' >${WORK_DIR}/schema.sql run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \