Skip to content

Commit

Permalink
Fix comparison bug in MariadbGTIDSet.Equal() function (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
okJiang authored Mar 14, 2024
1 parent 034c7ab commit 2199dfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mysql/mariadb_gtid.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ func (s *MariadbGTIDSet) Equal(o GTIDSet) bool {
if !ok {
return false
}
if len(serverSet) != len(set) {
return false
}
for serverID, gtid := range set {
if o, ok := serverSet[serverID]; !ok {
return false
Expand Down
1 change: 1 addition & 0 deletions mysql/mariadb_gtid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func TestMariaDBGTIDSetEqual(t *testing.T) {
{"1-1-1,2-2-2", "1-1-1", false},
{"1-1-1,2-2-2", "1-1-1,2-2-2", true},
{"1-1-1,2-2-2", "1-1-1,2-2-3", false},
{"0-1-1,0-2-2", "0-2-2", false},
}

for _, cs := range cases {
Expand Down

0 comments on commit 2199dfb

Please sign in to comment.