Activity log for bug #1545129

Date Who What changed Old value New value Message
2016-02-12 19:48:08 Daniël van Eeden bug added bug
2016-02-13 00:03:34 Simon J Mudd bug added subscriber Simon J Mudd
2016-02-13 07:56:39 Daniël van Eeden description Setup ===== DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( id tinyint unsigned auto_increment primary key, notunique varchar(200) NOT NULL ); INSERT INTO t1(notunique) VALUES('test01'),('test01'),('test02'); SELECT * FROM t1; Action ===== pt-online-schema-change --alter="ADD UNIQUE INDEX unique_1 (notunique)" --statistics --execute h=127.0.0.1,P=5711,D=test,t=t1,u=msandbox,p=msandbox Expected/Desired result =================== The osc aborts because the data for the unique index is not unique Actual result ========== On MySQL 5.6 data with duplicate entries are dropped silently On MySQL 5.7 data with duplicate entries are dropped with a warning 1062 in the stats (probably also for MariaDB 5.5+) Related ====== https://bugs.launchpad.net/percona-toolkit/+bug/1099836 Suggested fix =========== - Abort on warning 1062 if possible and/or require a --force-unique flag when adding adding an unique index. - Don't swap/drop if the original table has less rows than the original table Versions ======= - MySQL 5.7.11 - pt-online-schema-change 2.2.16 (git b1ca211) Setup ===== DROP TABLE IF EXISTS t1; CREATE TABLE t1 (   id tinyint unsigned auto_increment primary key,   notunique varchar(200) NOT NULL ); INSERT INTO t1(notunique) VALUES('test01'),('test01'),('test02'); SELECT * FROM t1; Action ===== pt-online-schema-change --alter="ADD UNIQUE INDEX unique_1 (notunique)" --statistics --execute h=127.0.0.1,P=5711,D=test,t=t1,u=msandbox,p=msandbox Expected/Desired result =================== The osc aborts because the data for the unique index is not unique Actual result ========== On MySQL 5.6 data with duplicate entries are dropped silently On MySQL 5.7 data with duplicate entries are dropped with a warning 1062 in the stats (probably also for MariaDB 5.5+) Related ====== https://bugs.launchpad.net/percona-toolkit/+bug/1099836 Suggested fix =========== - Abort on warning 1062 if possible and/or require a --force-unique flag when adding adding an unique index. - Don't swap/drop if the original table has less rows than the original table (count inserts? stats?) Versions ======= - MySQL 5.7.11 - pt-online-schema-change 2.2.16 (git b1ca211)
2017-03-26 09:43:26 Miklos Szel bug added subscriber Miklos Szel
2017-03-27 12:08:14 Carlos Salguero percona-toolkit: importance Undecided Critical
2017-03-27 12:08:18 Carlos Salguero percona-toolkit: assignee Carlos Salguero (carlos-salguero)
2017-03-30 06:09:37 Jericho Rivera percona-toolkit: status New Confirmed
2017-03-30 16:38:20 Carlos Salguero tags pt116
2017-04-20 18:28:46 Carlos Salguero percona-toolkit: status Confirmed Fix Committed
2017-04-20 18:28:51 Carlos Salguero percona-toolkit: milestone 3.0.3
2017-06-10 07:49:26 Carlos Salguero percona-toolkit: status Fix Committed Fix Released