diff --git a/go.mod b/go.mod index 079b279be4..e9290d05cd 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/rakyll/statik v0.1.6 github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 - github.com/siddontang/go-mysql v0.0.0-20200222075837-12e89848f047 + github.com/siddontang/go-mysql v1.1.1-0.20200824131207-0c5789dd0bd3 github.com/soheilhy/cmux v0.1.4 github.com/spf13/cobra v1.0.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 22bd8e2ef8..bf0d26d958 100644 --- a/go.sum +++ b/go.sum @@ -1061,6 +1061,8 @@ github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed h1:KMgQoLJGCq1Io github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed/go.mod h1:yFdBgwXP24JziuRl2NMUahT7nGLNOKi1SIiFxMttVD4= github.com/siddontang/go-mysql v0.0.0-20200222075837-12e89848f047 h1:boyJ8EgQN/aC3grvx8QUoJrptt7RvneezSJSCbW25a4= github.com/siddontang/go-mysql v0.0.0-20200222075837-12e89848f047/go.mod h1:+W4RCzesQDI11HvIkaDjS8yM36SpAnGNQ7jmTLn5BnU= +github.com/siddontang/go-mysql v1.1.1-0.20200824131207-0c5789dd0bd3 h1:t4iXtvFWrw0yfgf4Bm/KJtf4jOSnuXgs93ML+yLslSc= +github.com/siddontang/go-mysql v1.1.1-0.20200824131207-0c5789dd0bd3/go.mod h1:+W4RCzesQDI11HvIkaDjS8yM36SpAnGNQ7jmTLn5BnU= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= diff --git a/pkg/gtid/gtid_test.go b/pkg/gtid/gtid_test.go index 9951a6e08a..b51fe146f3 100644 --- a/pkg/gtid/gtid_test.go +++ b/pkg/gtid/gtid_test.go @@ -84,6 +84,16 @@ func (s *testGTIDSuite) TestGTID(c *C) { } } +func (s *testGTIDSuite) TestSortingGTIDSet(c *C) { + // check mysql + gSet, err := ParserGTID("mysql", "3ccc475b-2343-11e7-be21-6c0b84d59f30:1-14,406a3f61-690d-11e7-87c5-6c92bf46f384:1-94321383,53bfca22-690d-11e7-8a62-18ded7a37b78:1-495,05474d3c-28c7-11e7-8352-203db246dd3d:1-170,10b039fc-c843-11e7-8f6a-1866daf8d810:1-308290454,686e1ab6-c47e-11e7-a42c-6c92bf46f384:1-34981190,03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423") + c.Assert(err, IsNil) + sortedGTIDSet := "03fc0263-28c7-11e7-a653-6c0b84d59f30:1-7041423,05474d3c-28c7-11e7-8352-203db246dd3d:1-170,10b039fc-c843-11e7-8f6a-1866daf8d810:1-308290454,3ccc475b-2343-11e7-be21-6c0b84d59f30:1-14,406a3f61-690d-11e7-87c5-6c92bf46f384:1-94321383,53bfca22-690d-11e7-8a62-18ded7a37b78:1-495,686e1ab6-c47e-11e7-a42c-6c92bf46f384:1-34981190" + c.Assert(sortedGTIDSet, Equals, gSet.String()) + // check mariadb + // TODO: when go-mysql add sorting for mariadb, finish here +} + func (s *testGTIDSuite) TestMinGTIDSet(c *C) { gset := MinGTIDSet(mysql.MySQLFlavor) _, ok := gset.(*MySQLGTIDSet)