add only show dml control

master
兔子 1 year ago
parent b1b0733e53
commit 79f86a6dc8

@ -346,6 +346,7 @@ type BinlogFilter struct {
BigThan int BigThan int
SmallThan int SmallThan int
OnlyShowGtid bool OnlyShowGtid bool
OnlyShowDML bool
} }
func parseBinlogWithFilter(r io.Reader, parse *replication.BinlogParser, filter BinlogFilter, fn func(Transaction) bool) error { func parseBinlogWithFilter(r io.Reader, parse *replication.BinlogParser, filter BinlogFilter, fn func(Transaction) bool) error {
@ -449,7 +450,7 @@ func parseBinlogWithFilter(r io.Reader, parse *replication.BinlogParser, filter
if filter.SmallThan != 0 && filter.SmallThan < tx.Size { if filter.SmallThan != 0 && filter.SmallThan < tx.Size {
return true return true
} }
if !filter.OnlyShowGtid && tx.validSchemaCount == 0 { if !filter.OnlyShowGtid && filter.OnlyShowDML && tx.validSchemaCount == 0 {
return true return true
} }
return fn(tx) return fn(tx)

Loading…
Cancel
Save