master
兔子 1 year ago
parent 8b0423eb94
commit 79b68fe433

@ -238,7 +238,7 @@ func ParseBinlogEvent(ev *replication.BinlogEvent) []BinlogEvent {
case replication.WRITE_ROWS_EVENTv1, case replication.WRITE_ROWS_EVENTv1,
replication.WRITE_ROWS_EVENTv2: replication.WRITE_ROWS_EVENTv2:
wrEvent := ev.Event.(*replication.RowsEvent) wrEvent := ev.Event.(*replication.RowsEvent)
sig.TB = string(wrEvent.Table.Schema) sig.DB = string(wrEvent.Table.Schema)
sig.TB = string(wrEvent.Table.Table) sig.TB = string(wrEvent.Table.Table)
sig.Type = "insert" sig.Type = "insert"
sig.RowCnt = uint32(len(wrEvent.Rows)) sig.RowCnt = uint32(len(wrEvent.Rows))
@ -247,7 +247,7 @@ func ParseBinlogEvent(ev *replication.BinlogEvent) []BinlogEvent {
replication.UPDATE_ROWS_EVENTv2: replication.UPDATE_ROWS_EVENTv2:
wrEvent := ev.Event.(*replication.RowsEvent) wrEvent := ev.Event.(*replication.RowsEvent)
sig.DB = string(wrEvent.Table.Schema) sig.DB = string(wrEvent.Table.Schema)
sig.DB = string(wrEvent.Table.Table) sig.TB = string(wrEvent.Table.Table)
sig.Type = "update" sig.Type = "update"
sig.RowCnt = uint32(len(wrEvent.Rows)) / 2 sig.RowCnt = uint32(len(wrEvent.Rows)) / 2
sig.Rows = wrEvent.Rows sig.Rows = wrEvent.Rows
@ -466,6 +466,9 @@ func parseBinlogWithFilter(r io.Reader, parse *replication.BinlogParser, filter
tx.RowsCount += v.RowCount tx.RowsCount += v.RowCount
tx.Txs[k] = v tx.Txs[k] = v
} }
if filter.OnlyShowGtid {
tx.EndPos = startPos - 1
}
tx.Size = tx.EndPos - tx.StartPos tx.Size = tx.EndPos - tx.StartPos
callFn(tx) callFn(tx)
} }

Loading…
Cancel
Save