Fix conversion bug when string data comes from binlog by mattbooks · Pull Request #1571 · github/gh-ost
Fixes github#1568 When using gh-ost to migrate a table from latin1 to utf8mb3 character encoding, the initial data copy works correctly, but new data with special characters inserted during the migration via binlog replication fails with "Incorrect string value" errors. The reason for this is that the data is a binary byte array when converted from the binlog, so the character set conversion is not applied. This fix updates the character set conversion logic to apply to both string and []uint8 types when the column has a character set conversion. I added a new test for latin1 input to this method and confirmed that the reproduction from the linked issue is fixed with this change.
AI review requested due to automatic review settings
July 14, 2025 22:58This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters