mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-07 21:09:14 +00:00
Add --execute and die unless it's given. Enhance docu/risks about replication.
This commit is contained in:
@@ -33,7 +33,7 @@ else {
|
||||
|
||||
my $output = "";
|
||||
my $cnf = '/tmp/12345/my.sandbox.cnf';
|
||||
my @args = ('-F', $cnf);
|
||||
my @args = ('-F', $cnf, '--execute');
|
||||
my $exit = 0;
|
||||
my $rows;
|
||||
|
||||
|
@@ -29,12 +29,12 @@ elsif ( !$slave_dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox slave';
|
||||
}
|
||||
else {
|
||||
plan tests => 24;
|
||||
plan tests => 25;
|
||||
}
|
||||
|
||||
my $output = "";
|
||||
my $cnf = '/tmp/12345/my.sandbox.cnf';
|
||||
my @args = ('-F', $cnf);
|
||||
my @args = ('-F', $cnf, '--execute');
|
||||
my $exit = 0;
|
||||
my $rows;
|
||||
|
||||
@@ -43,6 +43,19 @@ PerconaTest::wait_for_table($slave_dbh, "mkosc.a", "c='r'");
|
||||
$master_dbh->do('use mkosc');
|
||||
$slave_dbh->do('use mkosc');
|
||||
|
||||
# #############################################################################
|
||||
# Tool shouldn't run without --execute (bug 933232).
|
||||
# #############################################################################
|
||||
$output = output(
|
||||
sub { pt_online_schema_change::main('h=127.1,P=12345,u=msandbox,p=msandbox,D=mkosc,t=a') },
|
||||
);
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/you did not specify --execute/,
|
||||
"Doesn't run without --execute"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# --check-tables-and-exit
|
||||
# #############################################################################
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 5;
|
||||
|
||||
use PerconaTest;
|
||||
|
||||
@@ -44,6 +44,13 @@ like(
|
||||
"Either DSN D part or --database required"
|
||||
);
|
||||
|
||||
$output = `$cmd --help`;
|
||||
like(
|
||||
$output,
|
||||
qr/--execute\s+FALSE/,
|
||||
"--execute FALSE by default"
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user