add more info

master
兔子 1 year ago
parent 393275a195
commit eec96dd25e

@ -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…
Cancel
Save