diff --git a/dm/pkg/checker/mysql_server.go b/dm/pkg/checker/mysql_server.go index 315de55db5b..1f0171391fe 100644 --- a/dm/pkg/checker/mysql_server.go +++ b/dm/pkg/checker/mysql_server.go @@ -35,14 +35,14 @@ func NewMySQLVersionChecker(db *sql.DB, dbinfo *dbutil.DBConfig) RealChecker { } // SupportedVersion defines the MySQL/MariaDB version that DM/syncer supports -// * 5.6.0 <= MySQL Version < 8.0.0. +// * 5.6.0 <= MySQL Version < 8.1.0. var SupportedVersion = map[string]struct { Min MySQLVersion Max MySQLVersion }{ "mysql": { MySQLVersion{5, 6, 0}, - MySQLVersion{8, 0, 0}, + MySQLVersion{8, 1, 0}, }, } diff --git a/dm/pkg/checker/mysql_server_test.go b/dm/pkg/checker/mysql_server_test.go index fe1762fb682..fddb1ea7048 100644 --- a/dm/pkg/checker/mysql_server_test.go +++ b/dm/pkg/checker/mysql_server_test.go @@ -33,8 +33,10 @@ func TestMysqlVersion(t *testing.T) { {"5.6.0-log", true}, {"5.7.0-log", true}, {"5.8.0-log", true}, // although it does not exist - {"8.0.1-log", false}, - {"8.0.20", false}, + {"8.0.1-log", true}, + {"8.0.20", true}, + {"8.0.35", true}, + {"8.1.0", false}, {"5.5.50-MariaDB-1~wheezy", false}, {"10.1.1-MariaDB-1~wheezy", false}, {"10.1.2-MariaDB-1~wheezy", false}, @@ -57,7 +59,7 @@ func TestVersionInstruction(t *testing.T) { db: db, dbinfo: &dbutil.DBConfig{}, } - mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version';").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("version", "8.0.20")) + mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version';").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("version", "8.1.0")) result := versionChecker.Check(context.Background()) require.Equal(t, result.State, StateWarning) require.Equal(t, result.Instruction, "It is recommended that you select a database version that meets the requirements before performing data migration. Otherwise data inconsistency or task exceptions might occur.") diff --git a/dm/pkg/checker/utils_test.go b/dm/pkg/checker/utils_test.go index 60e24bbdd17..cae6192d692 100644 --- a/dm/pkg/checker/utils_test.go +++ b/dm/pkg/checker/utils_test.go @@ -34,7 +34,8 @@ func TestVersionComparison(t *testing.T) { {"5.6.0", true, false, true, true}, {"5.7.0", true, true, true, true}, {"5.8.0", true, true, true, true}, // although it does not exist - {"8.0.1", true, true, false, false}, + {"8.0.1", true, true, true, true}, + {"8.1.0", true, true, false, true}, {"255.255.255", true, true, false, false}, // max version } diff --git a/dm/tests/dmctl_command/run.sh b/dm/tests/dmctl_command/run.sh index 7b22de9c18f..c3d39321c28 100644 --- a/dm/tests/dmctl_command/run.sh +++ b/dm/tests/dmctl_command/run.sh @@ -184,7 +184,6 @@ function check_task_lightning() { run_sql_tidb "set @@GLOBAL.max_connections=0;" run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "check-task $cur/conf/dm-task2.yaml" \ - "\"passed\": true" 1 \ "task precheck cannot accurately check the number of connection needed for Lightning" 0 run_sql_tidb "set @@GLOBAL.max_connections=5;" # fail but give warning, because it's using Lightining diff --git a/dm/tests/extend_column/run.sh b/dm/tests/extend_column/run.sh index 7d97f732810..362e9bf5f8d 100755 --- a/dm/tests/extend_column/run.sh +++ b/dm/tests/extend_column/run.sh @@ -44,7 +44,7 @@ function run_case() { "does not exist in downstream table" 2 \ "must contain extended columns" 2 \ '"severity": "fail"' 4 \ - '"severity": "warn"' 1 + '"severity": "warn"' 0 # create table in tidb run_sql_file $cur/data/tidb.prepare.sql $TIDB_HOST $TIDB_PORT $TIDB_PASSWORD