Skip to content

Commit

Permalink
check: remove restrictions for MySQL 8.0 (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored Jun 24, 2020
1 parent c409811 commit 8b94f57
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pkg/check/mysql_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ func NewMySQLVersionChecker(db *sql.DB, dbinfo *dbutil.DBConfig) Checker {
}

// SupportedVersion defines the MySQL/MariaDB version that DM/syncer supports
// * 5.6.0 <= MySQL Version < 5.8.0
// * 5.6.0 <= MySQL Version
// * 10.1.2 <= Mariadb Version
var SupportedVersion = map[string]struct {
Min MySQLVersion
Max MySQLVersion
}{
"mysql": {
MySQLVersion{5, 6, 0},
MySQLVersion{5, 8, 0},
MaxVersion,
},
"mariadb": {
MySQLVersion{10, 1, 2},
Expand All @@ -51,7 +51,7 @@ var SupportedVersion = map[string]struct {
}

// Check implements the Checker interface.
// we only support version >= 5.5
// we only support version >= 5.6
func (pc *MySQLVersionChecker) Check(ctx context.Context) *Result {
result := &Result{
Name: pc.Name(),
Expand Down
5 changes: 3 additions & 2 deletions pkg/check/mysql_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ func (t *testCheckSuite) TestMysqlVersion(c *tc.C) {
{"5.5.0-log", false},
{"5.6.0-log", true},
{"5.7.0-log", true},
{"5.8.0-log", false},
{"8.0.1-log", false},
{"5.8.0-log", true}, // although it does not exist
{"8.0.1-log", true},
{"8.0.20", true},
{"5.5.50-MariaDB-1~wheezy", false},
{"10.1.1-MariaDB-1~wheezy", false},
{"10.1.2-MariaDB-1~wheezy", true},
Expand Down
6 changes: 3 additions & 3 deletions pkg/check/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func (t *testCheckSuite) TestVersionComparsion(c *tc.C) {
{"5.5.0", false, false, true, true},
{"5.6.0", true, false, true, true},
{"5.7.0", true, true, true, true},
{"5.8.0", true, true, false, true},
{"8.0.1", true, true, false, false},
{"255.255.255", true, true, false, false},
{"5.8.0", true, true, true, true}, // although it does not exist
{"8.0.1", true, true, true, true},
{"255.255.255", true, true, false, true}, // max version
}

var (
Expand Down

0 comments on commit 8b94f57

Please sign in to comment.