add only show dml control

master
兔子 1 year ago
parent b1b0733e53
commit 79f86a6dc8

@ -346,6 +346,7 @@ type BinlogFilter struct {
BigThan int
SmallThan int
OnlyShowGtid bool
OnlyShowDML bool
}
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 {
return true
}
if !filter.OnlyShowGtid && tx.validSchemaCount == 0 {
if !filter.OnlyShowGtid && filter.OnlyShowDML && tx.validSchemaCount == 0 {
return true
}
return fn(tx)

Loading…
Cancel
Save