Add failing test case.

This commit is contained in:
Daniel Nichter
2012-10-20 12:09:20 -06:00
parent ca2675dd98
commit b8f6db2045
2 changed files with 31 additions and 0 deletions

View File

@@ -193,6 +193,26 @@ is_deeply(
$master_dbh->do(q{DROP DATABASE IF EXISTS `bug_1041372`});
# ############################################################################
# https://bugs.launchpad.net/percona-toolkit/+bug/1068562
# pt-online-schema-change loses data when renaming columns
# ############################################################################
$sb->load_file('master', "$sample/data-loss-bug-1068562.sql");
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args,
"$master_dsn,D=bug1068562,t=simon",
"--alter", "change old_column_name new_column_name varchar(255) NULL",
qw(--execute)) },
);
my $rows = $master_dbh->selectall_arrayref("SELECT * FROM bug1068562.simon ORDER BY id");
is_deeply(
$rows,
[ [qw(1 a)], [qw(2 b)], [qw(3 c)] ],
"Bug 1068562: no data lost"
) or diag(Dumper($rows));
# #############################################################################
# Done.
# #############################################################################

View File

@@ -0,0 +1,11 @@
drop database if exists bug1068562;
create database bug1068562;
use bug1068562;
CREATE TABLE `simon` (
`id` int(11) NOT NULL,
`old_column_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
insert into simon values (1,'a'),(2,'b'),(3,'c');