mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-19 18:34:59 +00:00
Removed local $EVAL_ERROR, added a test using t/lib/samples/broken_tbl.frm, and updated all modules
This commit is contained in:
@@ -3136,7 +3136,6 @@ sub _iterate_dbh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ( my $tbl = shift @{$self->{tbls}} ) {
|
while ( my $tbl = shift @{$self->{tbls}} ) {
|
||||||
local $EVAL_ERROR;
|
|
||||||
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
||||||
if ( my $e = $EVAL_ERROR ) {
|
if ( my $e = $EVAL_ERROR ) {
|
||||||
my $table_name = "$self->{db}.$tbl";
|
my $table_name = "$self->{db}.$tbl";
|
||||||
|
@@ -3966,7 +3966,6 @@ sub _iterate_dbh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ( my $tbl = shift @{$self->{tbls}} ) {
|
while ( my $tbl = shift @{$self->{tbls}} ) {
|
||||||
local $EVAL_ERROR;
|
|
||||||
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
||||||
if ( my $e = $EVAL_ERROR ) {
|
if ( my $e = $EVAL_ERROR ) {
|
||||||
my $table_name = "$self->{db}.$tbl";
|
my $table_name = "$self->{db}.$tbl";
|
||||||
|
@@ -6782,7 +6782,6 @@ sub _iterate_dbh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ( my $tbl = shift @{$self->{tbls}} ) {
|
while ( my $tbl = shift @{$self->{tbls}} ) {
|
||||||
local $EVAL_ERROR;
|
|
||||||
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
||||||
if ( my $e = $EVAL_ERROR ) {
|
if ( my $e = $EVAL_ERROR ) {
|
||||||
my $table_name = "$self->{db}.$tbl";
|
my $table_name = "$self->{db}.$tbl";
|
||||||
|
@@ -352,7 +352,6 @@ sub _iterate_dbh {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ( my $tbl = shift @{$self->{tbls}} ) {
|
while ( my $tbl = shift @{$self->{tbls}} ) {
|
||||||
local $EVAL_ERROR;
|
|
||||||
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
||||||
if ( my $e = $EVAL_ERROR ) {
|
if ( my $e = $EVAL_ERROR ) {
|
||||||
my $table_name = "$self->{db}.$tbl";
|
my $table_name = "$self->{db}.$tbl";
|
||||||
|
@@ -464,12 +464,49 @@ my $w = '';
|
|||||||
|
|
||||||
like(
|
like(
|
||||||
$w,
|
$w,
|
||||||
qr/because SHOW CREATE TABLE failed:/,
|
qr/bug_1047335.crashed_table because SHOW CREATE TABLE failed:/,
|
||||||
"->next() gives a warning if ->get_create_table dies from a strange error",
|
"->next() gives a warning if ->get_create_table dies from a strange error",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$dbh3->do(q{DROP DATABASE IF EXISTS bug_1047335_2});
|
||||||
|
$dbh3->do(q{CREATE DATABASE bug_1047335_2});
|
||||||
|
|
||||||
|
my $broken_frm = File::Spec->catfile($trunk, qw(t lib samples broken_tbl.frm));
|
||||||
|
my $db_dir_2 = File::Spec->catdir($master_basedir, "data", "bug_1047335_2");
|
||||||
|
|
||||||
|
use File::Copy qw(copy);
|
||||||
|
|
||||||
|
copy($broken_frm, $db_dir_2);
|
||||||
|
|
||||||
|
$dbh3->do("FLUSH TABLES");
|
||||||
|
|
||||||
|
$tmp_si = new SchemaIterator(
|
||||||
|
dbh => $dbh3,
|
||||||
|
OptionParser => $o,
|
||||||
|
Quoter => $q,
|
||||||
|
TableParser => $tp,
|
||||||
|
# This is needed because the way we corrupt tables
|
||||||
|
# accidentally removes the database from SHOW DATABASES
|
||||||
|
db => 'bug_1047335_2',
|
||||||
|
);
|
||||||
|
|
||||||
|
$w = '';
|
||||||
|
{
|
||||||
|
local $SIG{__WARN__} = sub { $w .= shift };
|
||||||
|
1 while $tmp_si->next();
|
||||||
|
}
|
||||||
|
|
||||||
|
like(
|
||||||
|
$w,
|
||||||
|
qr/\QSkipping bug_1047335_2.broken_tbl because SHOW CREATE TABLE failed:/,
|
||||||
|
"...same as above, but using t/lib/samples/broken_tbl.frm",
|
||||||
|
);
|
||||||
|
|
||||||
# This might fail. Doesn't matter -- stop_sandbox will just rm -rf the folder
|
# This might fail. Doesn't matter -- stop_sandbox will just rm -rf the folder
|
||||||
eval { $dbh3->do("DROP DATABASE IF EXISTS bug_1047335") };
|
eval {
|
||||||
|
$dbh3->do("DROP DATABASE IF EXISTS bug_1047335");
|
||||||
|
$dbh3->do("DROP DATABASE IF EXISTS bug_1047335_2");
|
||||||
|
};
|
||||||
|
|
||||||
diag(`$trunk/sandbox/stop-sandbox $master3_port >/dev/null`);
|
diag(`$trunk/sandbox/stop-sandbox $master3_port >/dev/null`);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user