Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-1552

pt-table-checksum fails on older MySQL without utf8mb4-support

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.9
    • Fix Version/s: None
    • Component/s: pt-table-checksum
    • Environment:

      Description

      Using pt-table-cheksum on an older MySQL replication setup (MySQL 5.1) pt-table-checksum fails with "Unknown character set: 'utf8mb4'" (full error message below)

      I've locally fixed this issue on my machine and attached a patch file to this report. Note that I have zero experience with perl, so there might be a more elegant solution.

      05-14T18:14:47 Error executing EXPLAIN SELECT COUNT AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `id`, convert(`columnname1` using utf8mb4), `columnname2`, `columnname3`, convert(`columnname4` using utf8mb4), `columnname5`, convert(`columnname6` using utf8mb4), convert(`columnname7` using utf8mb4), `columnname8`, `columnname9`, convert(`columnname10` using utf8mb4), convert(`columnname11` using utf8mb4), CONCAT(ISNULL(`columnname7`), ISNULL(`columnname8`), ISNULL(`columnname9`), ISNULL(`columnname10`), ISNULL(`columnname11`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `schemaName`.`tableName` /explain checksum table/: DBD::mysql::st execute failed: Unknown character set: 'utf8mb4' for Statement "EXPLAIN SELECT COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `id`, convert(`columnname1` using utf8mb4), `columnname2`, `columnname3`, convert(`columnname4` using utf8mb4), `columnname5`, convert(`columnname6` using utf8mb4), convert(`columnname7` using utf8mb4), `columnname8`, `columnname9`, convert(`columnname10` using utf8mb4), convert(`columnname11` using utf8mb4), CONCAT(ISNULL(`columnname7`), ISNULL(`columnname8`), ISNULL(`columnname9`), ISNULL(`columnname10`), ISNULL(`columnname11`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `schemaName`.`tableName` /*explain checksum table*/" at pt-table-checksum line 12205.05-14T18:14:47 Error checksumming table schemaName.tableName: Error executing checksum query: DBD::mysql::st execute failed: Unknown character set: 'utf8mb4' [for Statement "REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `id`, convert(`columnname1` using utf8mb4), `columnname2`, `columnname3`, convert(`columnname4` using utf8mb4), `columnname5`, convert(`columnname6` using utf8mb4), convert(`columnname7` using utf8mb4), `columnname8`, `columnname9`, convert(`columnname10` using utf8mb4), convert(`columnname11` using utf8mb4), CONCAT(ISNULL(`columnname7`), ISNULL(`columnname8`), ISNULL(`columnname9`), ISNULL(`columnname10`), ISNULL(`columnname11`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `schemaName`.`tableName` /*checksum table*/" with ParamValues: 0='schemaName', 1='tableName', 2=1, 3=undef, 4=undef, 5=undef] at pt-table-checksum line 11595.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                peteralmexx Peter van der Wal
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: