mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Fix for 1047335: SchemaIterator fails when it encounters a crashed table
This commit is contained in:
@@ -226,13 +226,11 @@ sub get_create_table {
|
||||
PTDEBUG && _d($show_sql);
|
||||
my $href;
|
||||
eval { $href = $dbh->selectrow_hashref($show_sql); };
|
||||
if ( $EVAL_ERROR ) {
|
||||
PTDEBUG && _d($EVAL_ERROR);
|
||||
|
||||
if ( my $e = $EVAL_ERROR ) {
|
||||
PTDEBUG && _d($old_sql_mode);
|
||||
$dbh->do($old_sql_mode);
|
||||
|
||||
return;
|
||||
die $e;
|
||||
}
|
||||
|
||||
PTDEBUG && _d($old_sql_mode);
|
||||
@@ -3138,7 +3136,18 @@ sub _iterate_dbh {
|
||||
}
|
||||
|
||||
while ( my $tbl = shift @{$self->{tbls}} ) {
|
||||
my $ddl = $tp->get_create_table($dbh, $self->{db}, $tbl);
|
||||
local $EVAL_ERROR;
|
||||
my $ddl = eval { $tp->get_create_table($dbh, $self->{db}, $tbl) };
|
||||
if ( my $e = $EVAL_ERROR ) {
|
||||
my $table_name = "$self->{db}.$tbl";
|
||||
if ( $e =~ /\QTable '$table_name' doesn't exist/ ) {
|
||||
PTDEBUG && _d("Skipping $table_name because it no longer exists");
|
||||
}
|
||||
else {
|
||||
warn "Skipping $table_name because SHOW CREATE TABLE failed: $e";
|
||||
}
|
||||
next;
|
||||
}
|
||||
my $tbl_struct = $tp->parse($ddl);
|
||||
if ( $self->engine_is_allowed($tbl_struct->{engine}) ) {
|
||||
return {
|
||||
|
Reference in New Issue
Block a user