Commit 65f88c6
authored
Fix conversion bug when string data comes from binlog (#1571)
* Fix conversion bug when string data comes from binlog
Fixes #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.
* Update whitespace formatting1 parent 70b65bd commit 65f88c6
2 files changed
+27
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | | - | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | | - | |
| 70 | + | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
0 commit comments