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

Incorrect casting of BIT columns by pt-archiver

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 3.3.1, 3.4.0
    • 3.5.2
    • None
    • None
    • Yes
    • Yes
    • 16

    Description

      Hello folks!

      Here's a simple test case showing how BIT columns used as a component of a PRIMARY KEY would break pt-archiver:

       

      CREATE TABLE `test`.`gerald` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `val` bit(1) NOT NULL DEFAULT b'0',
      PRIMARY KEY (`id`,`val`)
      ) ENGINE=InnoDB AUTO_INCREMENT=122 DEFAULT CHARSET=utf8mb4;
      CREATE TABLE test.gerald_tmp LIKE gerald;
      INSERT INTO test.gerald (val) VALUES (0),(1);
      INSERT INTO test.gerald (val) SELECT val FROM test.gerald ;
      INSERT INTO test.gerald (val) SELECT val FROM test.gerald ;
      INSERT INTO test.gerald_tmp SELECT NULL, val FROM test.gerald;
      $ ./pt-archiver --source A=utf8mb3,h=127.0.0.1,P=35387,p=msandbox,u=msandbox,D=test,t=gerald --purge --where '(val) in (select a.val from test.gerald_tmp a where id =2)' --progress 10 --limit 1 --no-check-charset --no-ascend
      # A software update is available:
      TIME                ELAPSED   COUNT
      2022-10-18T16:26:46       0       0
      DBD::mysql::st execute failed: Truncated incorrect DOUBLE value: '' [for Statement "DELETE FROM `test`.`gerald` WHERE (`id` = ? AND `val` = ?)" with ParamValues: 0=122, 1='.'] at ./pt-archiver line 6795.
      

      The empty string in DOUBLE value: '' corresponds to non-printable character 0x01.

       

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marcos.albe Marcos Albe
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist