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

pt-online-schema-change error with underscore starting FKs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Duplicate
    • Affects Version/s: 3.0.6
    • Fix Version/s: None
    • Component/s: None
    • Environment:

      Debian 8 with official pt repo

      Description

      Doing a dry run on an alter table for adding 2 columns without any index, I get this error :

       

      Dry run complete.  `ayt`.`transactions` was not altered.
      Error creating new table: DBD::mysql::db do failed: Can't create table `ayt`.`_transactions_new` (errno: 121 "Duplicate key on write or update") [for Statement "CREATE TABLE `ayt`.`_transactions_new` (

      Tried pt-duplicate-key-checker, but nothing on this side.

      The constraints are similar starting with single or double underscore, and I found many "fixed" bugs on here with similar errors, but I'm using the latest version of pt and it doesn't work with the following constraints :

          CONSTRAINT `__transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `__transactions_ibfk_2` FOREIGN KEY (`pavement_id`) REFERENCES `pavements` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `__transactions_ibfk_3` FOREIGN KEY (`application_id`) REFERENCES `afflictions` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `__transactions_ibfk_4` FOREIGN KEY (`cart_id`) REFERENCES `carts` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `__transactions_ibfk_5` FOREIGN KEY (`clone_id`) REFERENCES `clones` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `__transactions_ibfk_8` FOREIGN KEY (`refill_id`) REFERENCES `refills` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `_transactions_ibfk_1` FOREIGN KEY (`intuition_rate_id`) REFERENCES `intuition_rates` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `_transactions_ibfk_2` FOREIGN KEY (`intuition_pro_id`) REFERENCES `intuition_pros` (`id`) ON DELETE SET NULL ON UPDATE SET NULL,
          CONSTRAINT `_transactions_ibfk_3` FOREIGN KEY (`can_id`) REFERENCES `cans` (`id`) ON DELETE SET NULL ON UPDATE SET NULL

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jowo joan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Smart Checklist