add more info
This commit is contained in:
parent
393275a195
commit
eec96dd25e
12
parse.go
12
parse.go
@ -91,7 +91,17 @@ func parseBinlogDetail(r io.Reader, f func(Transaction)) error {
|
||||
for {
|
||||
headBuf := make([]byte, replication.EventHeaderSize)
|
||||
if _, err = io.ReadFull(r, headBuf); err == io.EOF {
|
||||
if tx.EndPos != 0 {
|
||||
idx := 0
|
||||
for k, v := range tx.Txs {
|
||||
if v.SqlType != "query" && len(tx.sqlOrigin) > idx {
|
||||
v.Sql = tx.sqlOrigin[idx]
|
||||
idx++
|
||||
}
|
||||
tx.RowsCount += v.RowCount
|
||||
tx.Txs[k] = v
|
||||
}
|
||||
tx.Size = tx.EndPos - tx.StartPos
|
||||
if f != nil {
|
||||
f(tx)
|
||||
}
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user