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

Commit

Permalink
writer: return true when FormatDescriptionEvent exist for `checkFor…
Browse files Browse the repository at this point in the history
…matDescriptionEventExist`
  • Loading branch information
csuzhangxc committed May 21, 2019
1 parent d536bd4 commit 6d54140
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions relay/writer/file_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ func checkFormatDescriptionEventExist(filename string) (bool, error) {

// only parse single event
eof, err := replication.NewBinlogParser().ParseSingleEvent(f, onEventFunc)
if err != nil {
if found {
return found, nil // if found is true, we return `true` even meet an error, because FormatDescriptionEvent exists.
} else if err != nil {
return false, errors.Annotatef(err, "parse %s", filename)
} else if eof {
if found {
return found, nil // if found is true, we return `true` even meet EOF, because FormatDescriptionEvent exists.
}
return false, errors.Annotatef(io.EOF, "parse %s", filename)
}
return found, nil
Expand Down

0 comments on commit 6d54140

Please sign in to comment.