Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM sync unit will corrupt data when upstream data is latin1 charset and code point > 7F #7028

Closed
lance6716 opened this issue Sep 9, 2022 · 1 comment · Fixed by #7027
Closed
Labels
affects-5.3 affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.2 area/dm Issues or PRs related to DM. severity/critical type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Sep 9, 2022

What did you do?

https://github.com/pingcap/tiflow/pull/7027/files

insert data Müller to a latin1 column at sync unit

insert into t5 (id, name) values (1, 'Müller');

What did you expect to see?

no data corript

What did you see instead?

becomes M�ller

MySQL [(none)]> select * from gbk.t5
    -> ;
+----+---------+---------+
| id | name    | name2   |
+----+---------+---------+
|  0 | Müller  | Müller  |
|  1 | M�ller   | Müller  |
+----+---------+---------+
2 rows in set (0.003 sec)

MySQL [(none)]> show create table gbk.t5;
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                                                                               |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t5    | CREATE TABLE `t5` (
  `id` int(11) NOT NULL,
  `name` varchar(20) DEFAULT NULL,
  `name2` varchar(20) DEFAULT 'Müller',
  PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin  |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)
@lance6716
Copy link
Contributor Author

related to pingcap/tidb#18955 but DM can do the conversion before replicate to TiDB

@lance6716 lance6716 changed the title DM sync unit will corrupt data when upstream is latin1 charset and character code point > 7F DM sync unit will corrupt data when upstream data is latin1 charset and code point > 7F Sep 9, 2022
3AceShowHand pushed a commit to 3AceShowHand/tiflow that referenced this issue Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.0 affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.2 area/dm Issues or PRs related to DM. severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants