mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-19 02:05:23 +00:00
Fix for 1002448
This commit is contained in:
@@ -29,7 +29,7 @@ elsif ( !$slave_dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox slave1';
|
||||
}
|
||||
else {
|
||||
plan tests => 2;
|
||||
plan tests => 3;
|
||||
}
|
||||
|
||||
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
|
||||
@@ -66,6 +66,23 @@ unlike(
|
||||
"Bug 994002: doesn't choose non-PK"
|
||||
);
|
||||
|
||||
# ############################################################################
|
||||
# https://bugs.launchpad.net/percona-toolkit/+bug/1002448
|
||||
# ############################################################################
|
||||
$sb->load_file('master', "$sample/bug-1002448.sql");
|
||||
|
||||
$output = output(
|
||||
sub { pt_online_schema_change::main(@args,
|
||||
"$master_dsn,D=test1002448,t=table_name",
|
||||
"--alter", "add column (foo int)",
|
||||
qw(--chunk-size 2 --dry-run --print)) },
|
||||
);
|
||||
|
||||
|
||||
unlike $output,
|
||||
qr/\QThe original table `test1002448`.`table_name` does not have a PRIMARY KEY or a unique index which is required for the DELETE trigger/,
|
||||
"Bug 1002448: mistakenly uses indexes instead of keys";
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
14
t/pt-online-schema-change/samples/bug-1002448.sql
Normal file
14
t/pt-online-schema-change/samples/bug-1002448.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
drop database if exists test1002448;
|
||||
create database test1002448;
|
||||
use test1002448;
|
||||
|
||||
CREATE TABLE `table_name` (
|
||||
`site` varchar(20) NOT NULL DEFAULT '',
|
||||
`update_name` varchar(32) NOT NULL DEFAULT '',
|
||||
`user` varchar(64) NOT NULL DEFAULT '',
|
||||
`time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`value` varchar(64) NOT NULL DEFAULT '',
|
||||
UNIQUE KEY `site` (`site`,`update_name`,`user`,`value`),
|
||||
KEY `user` (`user`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
|
Reference in New Issue
Block a user