osheroff/mysql-binlog-connector-java

isContainedWithin on MariadbGtidSet breaks the contract of it's super method

Closed this issue · 0 comments

com.github.shyiko.mysql.binlog.GtidSet#isContainedWithin says the following in its doc:

Determine if the GTIDs represented by this object are contained completely within the supplied set of GTIDs. Note that if two GtidSets are equal, then they both are subsets of the other.
Params:
other – the other set of GTIDs; may be null
Returns:
true if all of the GTIDs in this set are equal to or completely contained within the supplied set of GTIDs, or false otherwise

Unfortunately, MariadbGtidSet's override doesn't behave like this -- if the sets are equivalent, it returns false even though sets are subsets of themselves, so it can't be used to test logical equivalence. I noticed this when I tried to test if set a and b were logically equivalent by using a.isContainedWithin(b) && b.isContainedWithin(a)

This is a PR I opened to address this: #90