pt-table-sync does not handle utf8 strings in JSON columns correctly
General
Escalation
General
Escalation
Description
Environment
None
Activity
Show:
Aaditya Dubey September 13, 2024 at 10:17 AM
Hi
Thank you for the report and contribution.
Verified as described.
Bug Description
Similarly to ,
pt-table-sync
does not generate SQL statements correctly when they contain JSON strings that require correct utf8 handling.The root cause is an issue with
DBD::mysql
:The issue cannot be worked around with neither the flag
--charset
nor theA
flag of the DSN entries.Reproducing steps
Start a fresh sandbox with the tools from the git repository:
In the source database with port 12345, execute
In the replica database with port 12346, execute
Then execute
The output (with traces omitted) will be:
When the flag
--execute
is used, the generated statements themselves execute successfully but lead to false data entries as non-ASCII characters are wrongly encoded.