flink-cdc icon indicating copy to clipboard operation
flink-cdc copied to clipboard

fix: fix mysql-cdc case sensitive

Open a120610114 opened this issue 4 years ago • 4 comments

修复 mysql-cdc 因为大小写敏感导致 非自增型主键 chunks 分配大小不均匀问题。

修复逻辑: 1、mysqlcdc 非自增型主键方法均会走splitUnevenlySizedChunks 方法。 2、在splitUnevenlySizedChunks方法中在chunks之前判断主键collation 是否大小写敏感 3、mysql中字段类型 collation 为null 以及是以_ci 结尾的都是大小写不敏感的 4、如果主键大小写敏感,则走原逻辑。如果主键大小写不敏感则统一将字符转换为小写字符串 再进行ObjectUtils.compare比较

a120610114 avatar Jan 25 '22 02:01 a120610114

@a120610114 The changes looks well, could you add a test to validate the change?

leonardBang avatar Mar 07 '22 10:03 leonardBang

Hello @shizhengchao, sorry for the long delay of this PR. Could you please help rebase it with latest master branch before we can merge this?

Kindly reminder about some refactored packages:

  • MySQLTableSource and MySQLTableSourceFactory com.ververica.cdc.connectors.mysql.tableorg.apache.flink.cdc.connectors.mysql.table

Thanks again for your generous contribution!

yuxiqian avatar Apr 25 '24 05:04 yuxiqian

This pull request has been automatically marked as stale because it has not had recent activity for 60 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Jul 17 '24 00:07 github-actions[bot]