Comment 4 for bug 1705998

Revision history for this message
Jericho Rivera (jericho-rivera) wrote :

I can't seem to repeat it with latest pt-osc 3.0

percona:~/sandboxes/msb_5_7_18$ ./pt-online-schema-change --alter 'change column `Last_referenced` `cl1` datetime not null' --ask-pass --no-swap-tables --no-drop-triggers --no-drop-new-table --no-check-alter --execute D=test,t=t1,h=127.0.0.1,u=root,P=5718,S=/tmp/mysql_sandbox5718.sock
Enter MySQL password:
No slaves found. See --recursion-method if host percona has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
Operation, tries, wait:
  analyze_table, 10, 1
  copy_rows, 10, 0.25
  create_triggers, 10, 1
  drop_triggers, 10, 1
  swap_tables, 10, 1
  update_foreign_keys, 10, 1
Altering `test`.`t1`...
Renaming columns:
  Last_referenced to cl1
Creating new table...
Created new table test._t1_new OK.
Altering new table...
Altered `test`.`_t1_new` OK.
2017-08-03T12:13:47 Creating triggers...
2017-08-03T12:13:47 Created triggers OK.
2017-08-03T12:13:47 Copying approximately 1 rows...
2017-08-03T12:13:47 Copied rows OK.
Not dropping old table because --no-drop-triggers was specified.
Not dropping triggers because --no-drop-triggers was specified. To drop the triggers, execute:
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_t1_del`;
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_t1_upd`;
DROP TRIGGER IF EXISTS `test`.`pt_osc_test_t1_ins`;
Not dropping the new table `test`.`_t1_new` because --no-drop-new-table was specified. To drop the new table, execute:
DROP TABLE IF EXISTS `test`.`_t1_new`;
Successfully altered `test`.`t1`.

percona:~/sandboxes/msb_5_7_18$ ./use test -e "show create table t1\G"
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `c1` int(10) unsigned NOT NULL,
  `c2` varchar(255) NOT NULL,
  `Last_referenced` datetime NOT NULL,
  `c3` int(10) unsigned NOT NULL,
  `c4` int(10) unsigned NOT NULL DEFAULT '0',
  `c5` varchar(255) NOT NULL DEFAULT '',
  `c6` varchar(255) NOT NULL DEFAULT '',
  `c7` varchar(255) NOT NULL DEFAULT '',
  `c8` varchar(255) DEFAULT '',
  `c9` varchar(255) DEFAULT '',
  `c10` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c1`,`c2`),
  KEY `Last_Referenced_c6_Index` (`Last_referenced`,`c6`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

percona:~/sandboxes/msb_5_7_18$ ./use test -e "show tables"
+----------------+
| Tables_in_test |
+----------------+
| _t1_new |
| t1 |
+----------------+

percona:~/sandboxes/msb_5_7_18$ ./use test -e "show create table _t1_new\G"
*************************** 1. row ***************************
       Table: _t1_new
Create Table: CREATE TABLE `_t1_new` (
  `c1` int(10) unsigned NOT NULL,
  `c2` varchar(255) NOT NULL,
  `cl1` datetime NOT NULL,
  `c3` int(10) unsigned NOT NULL,
  `c4` int(10) unsigned NOT NULL DEFAULT '0',
  `c5` varchar(255) NOT NULL DEFAULT '',
  `c6` varchar(255) NOT NULL DEFAULT '',
  `c7` varchar(255) NOT NULL DEFAULT '',
  `c8` varchar(255) DEFAULT '',
  `c9` varchar(255) DEFAULT '',
  `c10` int(10) NOT NULL DEFAULT '0',
  PRIMARY KEY (`c1`,`c2`),
  KEY `Last_Referenced_c6_Index` (`cl1`,`c6`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1