December 23, 2023 - Find release notes at Percona Toolkit — Percona Toolkit Documentation
The json filed type content with wrong encode type:
The table define:
CREATE TABLE `t_article` (
`pk_article` bigint NOT NULL AUTO_INCREMENT,
`topics` json DEFAULT NULL ,
`title` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL ,
PRIMARY KEY (`pk_article`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ;
The Mysql Version: 8.0.28, 8.4.0
The source:
+------------+--------------------------------------+---------------------------+
| pk_article | topics | title |
+------------+--------------------------------------+---------------------------+
| 74 | ["中国", "美国", "China", "USA"] | 测试中文 test Chinese |
+------------+--------------------------------------+---------------------------+
The Dst:
+------------+--------------------------------------------------+---------------------------+
| pk_article | topics | title |
+------------+--------------------------------------------------+---------------------------+
| 74 | ["ä¸å½", "ç¾å½", "China", "USA"] | 测试中文 test Chinese |
+------------+--------------------------------------------------+---------------------------+
The Command:
pt-table-sync --verbose --execute --databases test h=127.0.0.1,P=6446,u=root,p=h=127.0.0.1,P=3401,u=root,p=
The Variables:
+--------------------------+------------------------------+
| Variable_name | Value |
+--------------------------+------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8mb3 |
| character_sets_dir | /data/mysql8/share/charsets/ |
+--------------------------+------------------------------+