pt-online-schema-change 2.2.14 can not create new table with --set-vars SQL_MODE option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Frank Cizmich |
Bug Description
I'm using pt-online-
i want alter some table but pt-online-
pt-online-
i can't not find at out put "Created new table" after "Creating new table..."
and process killed after a while.
the table's SQL_MODE is ''(NULL) so i add the --set-vars option at command.
(System SQL_MODE is not ''(NULL), @@sql_mode = STRICT_
COMMAMD :
$ PTDEBUG=1 ./pt-online-
at output, i find some evidence related with SQL_MODE
i wonder why set @@SQL_MODE := @OLD_SQL_MODE (line number 631) prior to create new table.
i think that using @@SQL_MODE('';) when create a new table is correct.
-------
621 Altering `idb`.`iseller`...
622 # CleanupTask:6170 94022 Created cleanup task CODE(0x3476198)
623 # pt_online_
624 #
625 # Percona:
626 # Percona:
627 #
628 # TableParser:3119 94022 /*!40101 SET @OLD_SQL_MODE := @@SQL_MODE, @@SQL_MODE := '', @OLD_QUOTE := 621 @@SQL_QUOTE_
629 # TableParser:3124 94022 DBI::db=
630 # TableParser:3128 94022 SHOW CREATE TABLE `idb`.`iseller`
631 # TableParser:3138 94022 /*!40101 SET @@SQL_MODE := @OLD_SQL_MODE, @@SQL_QUOTE_
632 Creating new table...
633 # pt_online_
634 # `USER_ID` varchar(10) COLLATE utf8mb4_bin NOT NULL,
635 # `PNUM_TXT` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL,
636 # PRIMARY KEY (`USER_ID`)
637 # ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=
638 # CleanupTask:6178 94022 Calling cleanup task CODE(0x3476198)
639 # pt_online_
640 `idb`.`iseller` was not altered.
-------
no more output.
pt-online-
and process killed after a while.
Changed in percona-toolkit: | |
status: | Incomplete → New |
tags: | added: pt-online-schema-change |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Enable to reproduce this case with 2.2.15. Can you try with new version? Also can you provide the table structure where you want to add columns? Valid test case will be better to understand this bug.
root@desktop:~# pt-online- schema- change --execute --no-drop-old-table --nocheck- replication- filters --charset=utf8mb4 --set-vars SQL_MODE=\'\' --alter "ADD COLUMN test2015 VARCHAR(1) COLLATE utf8mb4_bin DEFAULT NULL" D=test,t=nil 2>&1 foreign_ keys, 10, 1
No slaves found. See --recursion-method if host desktop has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
Operation, tries, wait:
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_
Altering `test`.`nil`...
Creating new table...
Created new table test._nil_new OK.
Altering new table...
Altered `test`.`_nil_new` OK.
2015-10-20T11:55:33 Creating triggers...
2015-10-20T11:55:33 Created triggers OK.
2015-10-20T11:55:33 Copying approximately 2 rows...
2015-10-20T11:55:33 Copied rows OK.
2015-10-20T11:55:33 Swapping tables...
2015-10-20T11:55:33 Swapped original and new tables OK.
Not dropping old table because --no-drop-old-table was specified.
2015-10-20T11:55:33 Dropping triggers...
2015-10-20T11:55:33 Dropped triggers OK.
Successfully altered `test`.`nil`.
root@desktop:~#