simplified appendBinlogEntry()
This commit is contained in:
parent
8aa6a9750c
commit
fb04eb232f
@ -160,11 +160,15 @@ func parseEntries(scanner *bufio.Scanner) (entries [](*BinlogEntry), err error)
|
|||||||
var endLogPos uint64
|
var endLogPos uint64
|
||||||
|
|
||||||
appendBinlogEntry := func() {
|
appendBinlogEntry := func() {
|
||||||
if binlogEntry.StatementType != "" {
|
if binlogEntry.LogPos == 0 {
|
||||||
entries = append(entries, binlogEntry)
|
return
|
||||||
log.Debugf("entry: %+v", *binlogEntry)
|
|
||||||
//fmt.Println(fmt.Sprintf("%s `%s`.`%s`", binlogEntry.StatementType, binlogEntry.DatabaseName, binlogEntry.TableName))
|
|
||||||
}
|
}
|
||||||
|
if binlogEntry.StatementType == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
entries = append(entries, binlogEntry)
|
||||||
|
log.Debugf("entry: %+v", *binlogEntry)
|
||||||
|
fmt.Println(fmt.Sprintf("%s `%s`.`%s`", binlogEntry.StatementType, binlogEntry.DatabaseName, binlogEntry.TableName))
|
||||||
}
|
}
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
switch state {
|
switch state {
|
||||||
@ -194,8 +198,6 @@ func parseEntries(scanner *bufio.Scanner) (entries [](*BinlogEntry), err error)
|
|||||||
return entries, log.Errore(err)
|
return entries, log.Errore(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if binlogEntry.LogPos != 0 {
|
appendBinlogEntry()
|
||||||
appendBinlogEntry()
|
|
||||||
}
|
|
||||||
return entries, err
|
return entries, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user