From f27c9db416501a308c8ef364c3be19934cec4e27 Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Wed, 3 Jan 2024 23:06:20 +0800 Subject: [PATCH 1/6] dm: support MySQL 8.0 GA --- dm/pkg/checker/mysql_server.go | 4 ++-- dm/pkg/checker/mysql_server_test.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dm/pkg/checker/mysql_server.go b/dm/pkg/checker/mysql_server.go index 315de55db5b..60c1f7d96a9 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.0.34. var SupportedVersion = map[string]struct { Min MySQLVersion Max MySQLVersion }{ "mysql": { MySQLVersion{5, 6, 0}, - MySQLVersion{8, 0, 0}, + MySQLVersion{8, 0, 34}, }, } diff --git a/dm/pkg/checker/mysql_server_test.go b/dm/pkg/checker/mysql_server_test.go index fe1762fb682..e8f9d1ff605 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.36", false}, + {"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.") From ef4f1e29ba4d7a54afecbba3c93327020ff7fb22 Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Thu, 4 Jan 2024 15:58:54 +0800 Subject: [PATCH 2/6] update --- dm/pkg/checker/utils_test.go | 3 ++- dm/tests/dmctl_command/run.sh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/pkg/checker/utils_test.go b/dm/pkg/checker/utils_test.go index 60e24bbdd17..9c4bec1f619 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, false}, {"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 From a4e8837fce1db7f667a65e204adb6dc4aba04452 Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Thu, 4 Jan 2024 16:59:53 +0800 Subject: [PATCH 3/6] update --- dm/tests/extend_column/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From acc35f85d96440b213e5f723730d513e81b1916f Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Thu, 4 Jan 2024 18:35:21 +0800 Subject: [PATCH 4/6] update --- dm/pkg/checker/mysql_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/pkg/checker/mysql_server.go b/dm/pkg/checker/mysql_server.go index 60c1f7d96a9..ed15438a84e 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.34. +// * 5.6.0 <= MySQL Version < 8.0.36. var SupportedVersion = map[string]struct { Min MySQLVersion Max MySQLVersion }{ "mysql": { MySQLVersion{5, 6, 0}, - MySQLVersion{8, 0, 34}, + MySQLVersion{8, 0, 36}, }, } From 2e079d8feb5944e17adaddd132d30bb91c84e4d7 Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Thu, 4 Jan 2024 21:55:16 +0800 Subject: [PATCH 5/6] update --- dm/pkg/checker/mysql_server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/pkg/checker/mysql_server.go b/dm/pkg/checker/mysql_server.go index ed15438a84e..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.36. +// * 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, 36}, + MySQLVersion{8, 1, 0}, }, } From 3607ac95a40ed815dbcdf2d1d6dafeff9373e195 Mon Sep 17 00:00:00 2001 From: lyzx2001 Date: Thu, 4 Jan 2024 23:21:51 +0800 Subject: [PATCH 6/6] update --- dm/pkg/checker/mysql_server_test.go | 2 +- dm/pkg/checker/utils_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dm/pkg/checker/mysql_server_test.go b/dm/pkg/checker/mysql_server_test.go index e8f9d1ff605..fddb1ea7048 100644 --- a/dm/pkg/checker/mysql_server_test.go +++ b/dm/pkg/checker/mysql_server_test.go @@ -35,7 +35,7 @@ func TestMysqlVersion(t *testing.T) { {"5.8.0-log", true}, // although it does not exist {"8.0.1-log", true}, {"8.0.20", true}, - {"8.0.36", false}, + {"8.0.35", true}, {"8.1.0", false}, {"5.5.50-MariaDB-1~wheezy", false}, {"10.1.1-MariaDB-1~wheezy", false}, diff --git a/dm/pkg/checker/utils_test.go b/dm/pkg/checker/utils_test.go index 9c4bec1f619..cae6192d692 100644 --- a/dm/pkg/checker/utils_test.go +++ b/dm/pkg/checker/utils_test.go @@ -35,7 +35,7 @@ func TestVersionComparison(t *testing.T) { {"5.7.0", true, true, true, true}, {"5.8.0", true, true, true, true}, // although it does not exist {"8.0.1", true, true, true, true}, - {"8.1.0", true, true, false, false}, + {"8.1.0", true, true, false, true}, {"255.255.255", true, true, false, false}, // max version }