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

pkg: support to sync alter database DDL (#388) #389

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')