PT-1574 Added a test case

This commit is contained in:
Carlos Salguero
2018-08-07 01:03:58 -03:00
parent 2b45f192b0
commit 7260bab2dc
2 changed files with 41 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ use File::Temp qw/ tempdir /;
if ($sandbox_version lt '5.7') {
plan skip_all => 'This test needs MySQL 5.7+';
} else {
plan tests => 3;
plan tests => 5;
}
require "$trunk/bin/pt-online-schema-change";
@@ -65,6 +65,27 @@ like(
"PT-1544 Message you need an unique index.",
);
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args, "$dsn,D=test,t=t2",
'--execute', "--chunk-index", "idx_id", "--chunk-size", "1",
"--nocheck-plan", '--alter', "engine=innodb",
),
},
stderr => 1,
);
isnt(
$exit_status,
0,
"PT-1544 There is no unique index exit status",
);
like(
$output,
qr/at least one UNIQUE and NOT NULLABLE index/s,
"PT-1544 Message you need an unique index.",
);
# #############################################################################
# Done.
# #############################################################################