Merge lp:~percona-toolkit-dev/percona-toolkit/fix-osc-repl-bug-933232.

This commit is contained in:
Daniel Nichter
2012-03-02 13:29:44 -08:00
4 changed files with 62 additions and 12 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

@@ -30,13 +30,26 @@ else {
my $output = "";
my $cnf = '/tmp/12345/my.sandbox.cnf';
my @args = ('-F', $cnf);
my @args = ('-F', $cnf, '--execute');
my $exit = 0;
my $rows;
$sb->load_file('master', "t/pt-online-schema-change/samples/small_table.sql");
$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.
# #############################################################################