- Notifications
You must be signed in to change notification settings - Fork 1k
Fix update MariaDB GTID #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3405465
to 046887b
Compare 046887b
to 6bb1699
Compare 6bb1699
to b60df2b
Compare b60df2b
to 5023fb6
Compare @siddontang PTAL |
mysql/mariadb_gtid.go Outdated
} | ||
| ||
return gtid == other | ||
return gtid.DomainID == other.DomainID && gtid.ServerID == other.ServerID && gtid.SequenceNumber == other.SequenceNumber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe return *gtid == *other just okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx & fixed
Thanks @NearTan What's wrong with value receiver? |
@siddontang if use value receiver, it should be return a value in UPDATE:
the GTID that re-sync uses has not been updated |
Got it PTAL @WangXiangUSTC |
mysql/mariadb_gtid_test.go Outdated
g3, err := ParseMariadbGTIDSet("0-1-2") | ||
c.Assert(err, check.IsNil) | ||
| ||
c.Assert(g1.Equal(g2), check.Equals, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.Assert(g1.Equal(g2), check.IsTrue)
@NearTan |
ffd8e43
to 80b6539
Compare @siddontang I have added a unit test to ensure MySQL GTID updating is OK |
@NearTan thanks for fix this bug. |
LGTM |
g1, err := ParseMysqlGTIDSet("3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57") | ||
c.Assert(err, check.IsNil) | ||
| ||
g1.Update("3E11FA47-71CA-11E1-9E33-C80AA9429562:21-58") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use 3E11FA47-71CA-11E1-9E33-C80AA9429562:58 is better
Fix a bug (here)
use pointer receiver instead of value receiver.