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

Commit

Permalink
cherry pick #1122 to release-2.0 (#1123)
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: lance6716 <lance6716@gmail.com>
  • Loading branch information
ti-srebot and lance6716 authored Sep 30, 2020
1 parent b779584 commit dc033a3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/dumpling/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func ParseMetaData(filename, flavor string) (*binlog.Location, *binlog.Location,
if err2 != nil {
return err2
}
line = strings.TrimSpace(line)
if len(line) == 0 {
return nil
}
parts := strings.SplitN(line, ":", 2)
if len(parts) != 2 {
continue
Expand Down
24 changes: 24 additions & 0 deletions pkg/dumpling/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,30 @@ Finished dump at: 2020-05-21 18:14:49`,
},
"5b5a8e4e-9b43-11ea-900d-0242ac170002:1-10,5b642cb6-9b43-11ea-8914-0242ac170003:1-9,97b5142f-e19c-11e8-808c-0242ac110005:1-13",
},
{ // no GTID sets
`Started dump at: 2020-09-30 12:16:49
SHOW MASTER STATUS:
Log: mysql-bin-changelog.000003
Pos: 12470000
SHOW MASTER STATUS: /* AFTER CONNECTION POOL ESTABLISHED */
Log: mysql-bin-changelog.000003
Pos: 12470000
Finished dump at: 2020-09-30 12:16:49
`,
mysql.Position{
Name: "mysql-bin-changelog.000003",
Pos: 12470000,
},
"",
true,
mysql.Position{
Name: "mysql-bin-changelog.000003",
Pos: 12470000,
},
"",
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit dc033a3

Please sign in to comment.