pt-table-sync does not handle utf8 strings in JSON columns correctly

Description

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 the A 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.

Environment

None

Activity

Show:

Aaditya Dubey September 13, 2024 at 10:17 AM

Hi

Thank you for the report and contribution.
Verified as described.

Done

Details

Assignee

Reporter

Priority

Components

Affects versions

Needs QA

Yes

Smart Checklist

Created September 11, 2024 at 9:42 AM
Updated January 14, 2025 at 3:27 PM
Resolved January 14, 2025 at 3:27 PM