pt-table-sync hits an error when the primary key is uuid binary

Description

The pt-table-sync hits the following error when the primary key is a UUID binary 16 column:

 

How to repeat:

Create the following table on Source:

Do the following inserts:

With the above done, do the following delete on the Replica server to have differences between servers:

Now it's time to run pt-table-checksum + pt-table-sync:

pt-table-checksum:

pt-table-sync:

Tool version:

Environment

None

AFFECTED CS IDs

CS0043022

Activity

Show:

Sveta Smirnova April 12, 2024 at 11:47 AM
Edited

Relevant code:

Sveta Smirnova April 12, 2024 at 11:46 AM
Edited

Example “dangerous” table definition:

Sveta Smirnova April 12, 2024 at 11:45 AM

Bug happens, because pt-table-sync re-implements prepared statements and replaces question marks in the generated query that finds nibble boundaries.

So this bug will happen for:

  • Indexes that contain question mark anywhere in the value

  • Tables with columns, named similar to test?table?id

pt-table-checksum will also fail for columns, named similar to test?table``number

Done

Details

Assignee

Reporter

Priority

Affects versions

Fix versions

Needs QA

Yes

Smart Checklist

Created January 18, 2024 at 12:43 AM
Updated June 12, 2024 at 6:49 PM
Resolved May 6, 2024 at 11:47 AM