From 4a6bfaf55b968f453d94cc9a37627af6f735923b Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Fri, 30 Jan 2026 15:05:47 +0800 Subject: [PATCH 1/5] sys collation check Signed-off-by: Jianjun Liao --- br/backup-and-restore-overview.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 00305ee8e8e41..630a64353e0ff 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -146,6 +146,8 @@ This section introduces the BR compatibility information for all [Long-Term Supp > **Note:** > > Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). +> +> Starting from version 8.5.5, if the system table data of the source cluster version does not have case-sensitivity conflicts (for example, simultaneous records of test.t1 and test.T1), you can specify the BR parameter --sys-check-collation during restoration. BR will then check the compatibility of the data across different collations. If compatible, backups from older versions can be successfully restored; otherwise, BR will return an error. The following table lists the compatibility matrix for full backups. Note that all information in the table applies to newly created clusters. For clusters upgraded from a version earlier than v7.2.0 to v7.2.0 or later, their behavior is consistent with that of backups from v7.1.0. From 002fbb7c9041caed7b8d96cecb6b6c44b380f550 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Thu, 5 Feb 2026 21:38:50 +0800 Subject: [PATCH 2/5] Update br/backup-and-restore-overview.md --- br/backup-and-restore-overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 630a64353e0ff..36c4b58c0ccf1 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -145,9 +145,9 @@ This section introduces the BR compatibility information for all [Long-Term Supp > **Note:** > -> Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). +> - Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). > -> Starting from version 8.5.5, if the system table data of the source cluster version does not have case-sensitivity conflicts (for example, simultaneous records of test.t1 and test.T1), you can specify the BR parameter --sys-check-collation during restoration. BR will then check the compatibility of the data across different collations. If compatible, backups from older versions can be successfully restored; otherwise, BR will return an error. +> - Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. The following table lists the compatibility matrix for full backups. Note that all information in the table applies to newly created clusters. For clusters upgraded from a version earlier than v7.2.0 to v7.2.0 or later, their behavior is consistent with that of backups from v7.1.0. From a7bf969e85257dc48cefb2bb7b1617cbdc767ca3 Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Mon, 9 Feb 2026 11:34:24 +0800 Subject: [PATCH 3/5] commit some suggestions Signed-off-by: Jianjun Liao --- br/backup-and-restore-overview.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 36c4b58c0ccf1..6e598d1c2e9c2 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -147,7 +147,15 @@ This section introduces the BR compatibility information for all [Long-Term Supp > > - Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). > -> - Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. +> - Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. If the upstream cluster still exists before the restore, you can manually execute the following three sets of SQL statements in the upstream cluster to verify data compatibility across different collations by confirming that the COUNT results are consistent: +> - SQL 1:SELECT COUNT(1) FROM mysql.db; +> - SQL 1:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User FROM mysql.db GROUP BY Host, DB COLLATE utf8mb4_general_ci, User) as a; +> +> - SQL 2:SELECT COUNT(1) FROM mysql.tables_priv; +> - SQL 2:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci FROM mysql.tables_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci) as a; +> +> - SQL 3:SELECT COUNT(1) FROM mysql.columns_priv; +> - SQL 3:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci FROM mysql.columns_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci) as a; The following table lists the compatibility matrix for full backups. Note that all information in the table applies to newly created clusters. For clusters upgraded from a version earlier than v7.2.0 to v7.2.0 or later, their behavior is consistent with that of backups from v7.1.0. From a6dd46435e3be9a6fafae4e8f09aafca9fc4e812 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Mon, 9 Feb 2026 12:09:04 +0800 Subject: [PATCH 4/5] Update backup-and-restore-overview.md --- br/backup-and-restore-overview.md | 35 +++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 6e598d1c2e9c2..5972f0ce096b3 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -145,17 +145,30 @@ This section introduces the BR compatibility information for all [Long-Term Supp > **Note:** > -> - Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). -> -> - Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. If the upstream cluster still exists before the restore, you can manually execute the following three sets of SQL statements in the upstream cluster to verify data compatibility across different collations by confirming that the COUNT results are consistent: -> - SQL 1:SELECT COUNT(1) FROM mysql.db; -> - SQL 1:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User FROM mysql.db GROUP BY Host, DB COLLATE utf8mb4_general_ci, User) as a; -> -> - SQL 2:SELECT COUNT(1) FROM mysql.tables_priv; -> - SQL 2:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci FROM mysql.tables_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci) as a; -> -> - SQL 3:SELECT COUNT(1) FROM mysql.columns_priv; -> - SQL 3:SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci FROM mysql.columns_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci) as a; +> Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). + +Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. If the upstream cluster still exists before the restore, you can manually execute the following three sets of SQL statements in the upstream cluster to verify data compatibility across different collations by confirming that the COUNT results are consistent: + +SQL set 1: + +```sql +SELECT COUNT(1) FROM mysql.db; +SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User FROM mysql.db GROUP BY Host, DB COLLATE utf8mb4_general_ci, User) as a; +``` + +SQL set 2: + +```sql +SELECT COUNT(1) FROM mysql.tables_priv; +SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci FROM mysql.tables_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci) as a; +``` + +SQL set 3: + +```sql +SELECT COUNT(1) FROM mysql.columns_priv; +SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci FROM mysql.columns_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci) as a; +``` The following table lists the compatibility matrix for full backups. Note that all information in the table applies to newly created clusters. For clusters upgraded from a version earlier than v7.2.0 to v7.2.0 or later, their behavior is consistent with that of backups from v7.1.0. From 9059f6435b2c1419f25970a345421199426f7f45 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Mon, 9 Feb 2026 13:32:25 +0800 Subject: [PATCH 5/5] Update backup-and-restore-overview.md --- br/backup-and-restore-overview.md | 46 ++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/br/backup-and-restore-overview.md b/br/backup-and-restore-overview.md index 5972f0ce096b3..5438482bb5676 100644 --- a/br/backup-and-restore-overview.md +++ b/br/backup-and-restore-overview.md @@ -147,29 +147,61 @@ This section introduces the BR compatibility information for all [Long-Term Supp > > Known issue: Starting from version v7.2.0, some system table fields in newly created clusters are case-insensitive. However, for clusters that are **upgraded online** from versions earlier than v7.2.0 to v7.2.0 or later, the corresponding system table fields remain case-sensitive. Backup and restore operations involving system tables between these two types of clusters might fail. For more details, see [Issue #43717](https://github.com/pingcap/tidb/issues/43717). -Starting from v8.5.5, if the system tables in the cluster do not contain case-conflicting records (for example, both `test.t1` and `test.T1`), you can specify the BR parameter` --sys-check-collation` during restore. BR checks whether the system table data is compatible across different collations. If it is compatible, BR can successfully restore backups from earlier versions; otherwise, BR reports an error and stops the restore. If the upstream cluster still exists before the restore, you can manually execute the following three sets of SQL statements in the upstream cluster to verify data compatibility across different collations by confirming that the COUNT results are consistent: +
+Verify whether the system table data remains compatible under the target cluster's collation -SQL set 1: +Starting from v8.5.5, BR supports checking collation compatibility when restoring system tables by using the `--sys-check-collation` parameter. During restore, BR verifies whether the system table data remains compatible under the target cluster's collation. + +- If the data is compatible with the target collation, BR can successfully restore backups from earlier versions. +- If conflicts are detected (for example, both `test.t1` and `test.T1` exist), BR reports an error and terminates the restore. + +If the upstream cluster is still available before the restore, you can run the following SQL statements on the upstream cluster to perform a precheck on the system tables. By comparing the original row count with the row count after grouping under the target collation, you can determine whether conflicts would occur under the target collation. + +Replace `utf8mb4_general_ci` in the following SQL statements with the default collation of the target cluster. + +Group 1 ```sql SELECT COUNT(1) FROM mysql.db; -SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User FROM mysql.db GROUP BY Host, DB COLLATE utf8mb4_general_ci, User) as a; +SELECT COUNT(1) FROM ( + SELECT Host, DB COLLATE utf8mb4_general_ci, User + FROM mysql.db + GROUP BY Host, DB COLLATE utf8mb4_general_ci, User +) AS a; ``` -SQL set 2: +Group 2 ```sql SELECT COUNT(1) FROM mysql.tables_priv; -SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci FROM mysql.tables_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci) as a; +SELECT COUNT(1) FROM ( + SELECT Host, DB COLLATE utf8mb4_general_ci, User, + Table_name COLLATE utf8mb4_general_ci + FROM mysql.tables_priv + GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, + Table_name COLLATE utf8mb4_general_ci +) AS a; ``` -SQL set 3: +Group 3 ```sql SELECT COUNT(1) FROM mysql.columns_priv; -SELECT COUNT(1) FROM (SELECT Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci FROM mysql.columns_priv GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, Table_name COLLATE utf8mb4_general_ci, Column_name COLLATE utf8mb4_general_ci) as a; +SELECT COUNT(1) FROM ( + SELECT Host, DB COLLATE utf8mb4_general_ci, User, + Table_name COLLATE utf8mb4_general_ci, + Column_name COLLATE utf8mb4_general_ci + FROM mysql.columns_priv + GROUP BY Host, DB COLLATE utf8mb4_general_ci, User, + Table_name COLLATE utf8mb4_general_ci, + Column_name COLLATE utf8mb4_general_ci +) AS a; ``` +If the two `COUNT` results are equal, no case-insensitive conflicts will occur under the target collation. + +
+ The following table lists the compatibility matrix for full backups. Note that all information in the table applies to newly created clusters. For clusters upgraded from a version earlier than v7.2.0 to v7.2.0 or later, their behavior is consistent with that of backups from v7.1.0. | Backup version | Compatible restore versions | Incompatible restore versions |