Merge fix-osc-innodb-bug-996110.

This commit is contained in:
Daniel Nichter
2012-05-16 17:42:14 -06:00
3 changed files with 67 additions and 3 deletions

View File

@@ -5030,7 +5030,11 @@ sub main {
PTDEBUG && _d($dbh, $sql);
my (undef, $curr_lwt) = $dbh->selectrow_array($sql);
PTDEBUG && _d('innodb_lock_wait_timeout on server:', $curr_lwt);
if ( $curr_lwt > $lock_wait_timeout ) {
if ( !defined $curr_lwt ) {
PTDEBUG && _d('innodb_lock_wait_timeout does not exist;',
'InnoDB is probably disabled');
}
elsif ( $curr_lwt > $lock_wait_timeout ) {
warn "Failed to $set_lwt: $EVAL_ERROR\n"
. "The current innodb_lock_wait_timeout value "
. "$curr_lwt is greater than the --lock-wait-timeout "

View File

@@ -0,0 +1,60 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
require "$trunk/bin/pt-online-schema-change";
diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`);
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master 12348';
}
else {
plan tests => 2;
}
my $master_dsn = 'h=127.1,P=12348,u=msandbox,p=msandbox';
my @args = (qw(--lock-wait-timeout 3), '--max-load', '');
my $output;
my $retval;
$output = output(
sub { $retval = pt_online_schema_change::main(@args,
"$master_dsn,D=mysql,t=user", "--alter", "add column (foo int)",
qw(--dry-run)) },
stderr => 1,
);
like(
$output,
qr/`mysql`.`user`/,
"Ran without InnoDB (bug 994010)"
);
is(
$retval,
0,
"0 exit status (bug 994010)"
);
# #############################################################################
# Done.
# #############################################################################
diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
exit;

View File

@@ -55,13 +55,13 @@ $output = output(
like(
$output,
qr/mysql/,
"Ran without InnoDB (bug 994010)"
"Ran without InnoDB (bug 996110)"
);
is(
$retval,
0,
"0 exit status (bug 994010)"
"0 exit status (bug 996110)"
);
# #############################################################################