Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
pkg: support to sync alter database DDL (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored and csuzhangxc committed Dec 2, 2019
1 parent 4e9b6db commit edad4c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions pkg/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ var (
"^RENAME\\s+USER",
"^DROP\\s+USER",
"^SET\\s+PASSWORD",

// alter database
"^ALTER DATABASE",
}
builtInSkipDDLPatterns *regexp.Regexp
)
Expand Down
4 changes: 0 additions & 4 deletions syncer/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ END`, true},
{"drop user t1", true},
{"GRANT ALL PRIVILEGES ON *.* TO 't2'@'%' IDENTIFIED WITH 'mysql_native_password' AS '*12033B78389744F3F39AC4CE4CCFCAD6960D8EA0'", true},
{"revoke reload on *.* from 't2'@'%'", true},

// alter database
{"alter database foo character set = utf8", true},
{"alter database foo collate=utf8_bin", true},
}

//filter, err := bf.NewBinlogEvent(nil)
Expand Down
3 changes: 3 additions & 0 deletions tests/all_mode/data/db1.increment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ update t1 set name = 'gentestxxxxxx' where gen_id = 124;
-- delete with unique key
delete from t1 where gen_id > 124;

-- test alter database
alter database all_mode CHARACTER SET = utf8mb4;

-- test decimal type
alter table t1 add column lat decimal(9,6) default '0.000000';
insert into t1 (id, name, info, lat) values (8, 'gentest', '{"id":127}', '123.123')

0 comments on commit edad4c2

Please sign in to comment.