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

LP #1697915: pt-online-schema-change remove the old and new table

Details

    Description

      **Reported in Launchpad by Hamoon Mohammadian Pour last update 29-06-2017 05:53:20

      Hello.
      Today I altered one of my tables (users) with pt-online-schema-change
      One table(user_comments) of my database had a foreign key (refer) to users table.
      I changed id column from int to bigint
      But at the end when it wanted to rename new table to original table, this message was displayed:
      Error updating foreign key constraints: 2017-06-14T10:17:41 DBD::mysql::db do failed: Error on rename of './myblog/_users_new' to './myblog/users' (errno: 150 "Foreign key constraint is incorrectly formed") [for Statement "RENAME TABLE `myblog`.`_users_new` TO `myblog`.`users`"] at /usr/bin/pt-online-schema-change line 10700.
      I know what is this, and I know firstly I must alter user_comments table or removeForeign key before alter users table, but I think pt-online-schema-change has bug because it should be kept up new table.
      It was full command:
      pt-online-schema-change -uxxxx -pxxxx --max-load "Threads_running=400" --set-vars=foreign_key_checks=0 --alter-foreign-keys-method=auto --no-check-alter --critical-load="Threads_running=200" --alter="CHANGE COLUMN id id BIGINT UNSIGNED NOT NULL FIRST" D=myblog,t=users --execute
      MariaDB Version: mariadb-galera-10.0.30
      pt-online-schema-change Version: 3.0.3

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lpjirasync lpjirasync (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist