Skip to content

Commit 2199dfb

Browse files
authored
Fix comparison bug in MariadbGTIDSet.Equal() function (#853)
1 parent 034c7ab commit 2199dfb

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

mysql/mariadb_gtid.go

+3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ func (s *MariadbGTIDSet) Equal(o GTIDSet) bool {
217217
if !ok {
218218
return false
219219
}
220+
if len(serverSet) != len(set) {
221+
return false
222+
}
220223
for serverID, gtid := range set {
221224
if o, ok := serverSet[serverID]; !ok {
222225
return false

mysql/mariadb_gtid_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ func TestMariaDBGTIDSetEqual(t *testing.T) {
181181
{"1-1-1,2-2-2", "1-1-1", false},
182182
{"1-1-1,2-2-2", "1-1-1,2-2-2", true},
183183
{"1-1-1,2-2-2", "1-1-1,2-2-3", false},
184+
{"0-1-1,0-2-2", "0-2-2", false},
184185
}
185186

186187
for _, cs := range cases {

0 commit comments

Comments
 (0)