diff --git a/dump/parser.go b/dump/parser.go index 2e9a18e0d..dd39f8015 100644 --- a/dump/parser.go +++ b/dump/parser.go @@ -35,7 +35,7 @@ func init() { // The pattern will only match MySQL GTID, as you know SET GLOBAL gtid_slave_pos='0-1-4' is used for MariaDB. // SET @@GLOBAL.GTID_PURGED='1638041a-0457-11e9-bb9f-00505690b730:1-429405150'; // https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html - gtidExp = regexp.MustCompile(`(\w{8}(-\w{4}){3}-\w{12}(:\d+-\d+)+)`) + gtidExp = regexp.MustCompile(`(\w{8}(-\w{4}){3}-\w{12}(:\d+(-\d+)?)+)`) } // Parse the dump data with Dumper generate. diff --git a/dump/parser_test.go b/dump/parser_test.go index d3a33060f..73d301559 100644 --- a/dump/parser_test.go +++ b/dump/parser_test.go @@ -44,6 +44,11 @@ e7574090-b123-11e8-8bb4-005056a29643:1-12' `, "e50bd2d3-6ad7-11e9-890c-42010af0017c:1-5291126581:5291126583-5323107666", }, + {`SET @@GLOBAL.GTID_PURGED='071a84e8-b253-11e8-8472-005056a27e86:1, +2337be48-0456-11e9-bd1c-00505690543b:1-7, +5f1eea9e-b1e5-11e8-bc77-005056a221ed:1-144609156, +e7574090-b123-11e8-8bb4-005056a29643:1' +`, "071a84e8-b253-11e8-8472-005056a27e86:1,2337be48-0456-11e9-bd1c-00505690543b:1-7,5f1eea9e-b1e5-11e8-bc77-005056a221ed:1-144609156,e7574090-b123-11e8-8bb4-005056a29643:1"}, } for _, tt := range tbls { diff --git a/dump/setup_test.go b/dump/setup_test.go index ca2d4d0b8..b2e2a694e 100644 --- a/dump/setup_test.go +++ b/dump/setup_test.go @@ -10,7 +10,7 @@ import ( // use docker mysql for test var host = flag.String("host", "127.0.0.1", "MySQL host") -var port = flag.Int("port", 3306, "MySQL host") +var port = flag.Int("port", 3306, "MySQL port") var execution = flag.String("exec", "mysqldump", "mysqldump execution path")