Add --execute and die unless it's given. Enhance docu/risks about replication.

This commit is contained in:
Daniel Nichter
2012-03-02 12:30:16 -08:00
parent 7c76b25179
commit 866a042444
4 changed files with 61 additions and 11 deletions

View File

@@ -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;

View File

@@ -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
# #############################################################################

View File

@@ -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.
# #############################################################################