Not dropping old table while the option "--no-drop-old-table" is not specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
New
|
Undecided
|
Unassigned |
Bug Description
This is on version 3.0.5.
We did a pt-online-
Copying `xxxx_schema`
Replica lag is 8 seconds on opskins-
Copying `xxxx_schema`
2017-11-29T03:31:54 Copied rows OK.
Determining the method to update foreign keys...
2017-11-29T03:31:54 `xxxx_schema`
2017-11-29T03:31:54 Drop-swapping tables...
2017-11-29T03:31:54 Analyzing new table...
SET foreign_
DROP TABLE IF EXISTS `xxxx_schema`
RENAME TABLE `xxxx_schema`
2017-11-29T03:31:55 Dropped and swapped tables OK.
Not dropping old table because --no-drop-old-table was specified.
2017-11-29T03:31:55 Dropping triggers...
DROP TRIGGER IF EXISTS `xxxx_schema`
DROP TRIGGER IF EXISTS `xxxx_schema`
DROP TRIGGER IF EXISTS `xxxx_schema`
2017-11-29T03:31:55 Dropped triggers OK.
Successfully altered `xxxx_schema`
There, it says "Not dropping old table because --no-drop-old-table was specified.". However, the command we used is:
$ pt-online-
CHARSET='utf8mb4', \
COLLATE=
CHANGE COLUMN currency_type currency_type TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', \
CHANGE COLUMN coins coins DECIMAL(30, 18) NOT NULL, \
CHANGE COLUMN amount_
CHANGE COLUMN new_coins_balance new_coins_balance DECIMAL(30, 18) NOT NULL, \
CHANGE COLUMN new_amount_
CHANGE COLUMN coins_reverted coins_reverted DECIMAL(30, 18) NOT NULL DEFAULT '0', \
CHANGE COLUMN coins_nocashout
CHANGE COLUMN comment comment VARCHAR(255) NULL DEFAULT NULL, \
ADD COLUMN flags INT UNSIGNED NOT NULL DEFAULT '0' AFTER comment \
" --tries copy_rows:
When I checked the code, there's only one line there but under "else" which I bet its the reason why it's printing this:
9951 }
9952 elsif ( !$drop_triggers ) {
9953 print "Not dropping old table because --no-drop-triggers was specified.\n";
9954 }
9955 else {
9956 print "Not dropping old table because --no-drop-old-table was specified.\n";
9957 }
9958
Solution: I see if we just have to enclosed that line 9956 to another "elseif" statement, might filter and avoid that from printing a false positive log information.
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-1463