diff --git a/parse.go b/parse.go index 5d62306..1b512f1 100644 --- a/parse.go +++ b/parse.go @@ -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)