bug-1593265 Fixed pt-archiver deletes wrong rows

In the case we are trying to migrate a table with no PK nor an unique
key, pt-archiver was failing to select the correct rows for deletion.
This fix implemented here is to add ALL columns in the WHERE clause of
the DELETE command. This way, we are deleting only the exact same row we
just migrated but using columns instead of an index.
This commit is contained in:
Carlos Salguero
2016-06-22 13:17:57 -03:00
parent 4534b731ad
commit 01daf0030e
8 changed files with 83 additions and 6 deletions

View File

@@ -0,0 +1,13 @@
CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
create table t1 (a int, b int, key (a),key(b));
create table t2 like t1;
insert into t1 (a,b) values (10,5);
insert into t1 (a,b) values (10,4);
insert into t1 (a,b) values (10,3);
insert into t1 (a,b) values (10,2);
insert into t1 (a,b) values (10,1);