Skip to content

Conversation

NearTan
Copy link
Contributor

@NearTan NearTan commented Oct 26, 2017

Fix a bug (here)

use pointer receiver instead of value receiver.

@NearTan NearTan changed the title Fix update mariadb gtid[WIF] Fix update mariadb gtid[WIP] Oct 26, 2017
@NearTan NearTan force-pushed the fix-mariadb-gtid branch 2 times, most recently from 3405465 to 046887b Compare October 26, 2017 10:41
@NearTan NearTan changed the title Fix update mariadb gtid[WIP] Fix update MariaDB GTID Oct 26, 2017
@NearTan
Copy link
Contributor Author

NearTan commented Oct 26, 2017

}

return gtid == other
return gtid.DomainID == other.DomainID && gtid.ServerID == other.ServerID && gtid.SequenceNumber == other.SequenceNumber
Copy link

@MOON-CLJ MOON-CLJ Oct 26, 2017

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx & fixed

@siddontang
Copy link
Collaborator

Thanks @NearTan

What's wrong with value receiver?

@NearTan
Copy link
Contributor Author

NearTan commented Oct 27, 2017

@siddontang if use value receiver, it should be return a value in update function, otherwise it will not take any effect

UPDATE:

INFO[0000] start sync binlog at GTID 0-2564583961-683620516 INFO[0002] rotate to (log.000257, 4) INFO[0002] rotate binlog to (log.000257, 4) INFO[0004] rotate to (log.000258, 4) INFO[0004] rotate to (log.000258, 4) INFO[0004] rotate binlog to (log.000258, 4) INFO[0004] rotate binlog to (log.000258, 4) INFO[0181] rotate to (log.000259, 4) INFO[0181] rotate to (log.000259, 4) INFO[0181] rotate binlog to (log.000259, 4) INFO[0181] rotate binlog to (log.000259, 4) ERRO[2123] connection was bad INFO[2124] begin to re-sync from 0-2564583961-683620516 

the GTID that re-sync uses has not been updated

@siddontang
Copy link
Collaborator

Got it

PTAL @WangXiangUSTC

g3, err := ParseMariadbGTIDSet("0-1-2")
c.Assert(err, check.IsNil)

c.Assert(g1.Equal(g2), check.Equals, true)
Copy link
Collaborator

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)

@siddontang
Copy link
Collaborator

@NearTan
Do we have the same problem for MySQL GTID?

@NearTan
Copy link
Contributor Author

NearTan commented Oct 27, 2017

@WangXiangUSTC
Copy link
Contributor

@NearTan thanks for fix this bug.
LGTM

@siddontang
Copy link
Collaborator

LGTM

@siddontang siddontang merged commit c6f8498 into go-mysql-org:master Oct 27, 2017
g1, err := ParseMysqlGTIDSet("3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57")
c.Assert(err, check.IsNil)

g1.Update("3E11FA47-71CA-11E1-9E33-C80AA9429562:21-58")
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants