Handle losing replica connection in check_slave_tables(). Add save eval error in TableParser::check_table() in check_table_error.

This commit is contained in:
Daniel Nichter
2015-06-24 18:20:02 -07:00
parent 921a2fe7ff
commit 7764955209
2 changed files with 81 additions and 41 deletions

View File

@@ -306,6 +306,8 @@ sub check_table {
my $db_tbl = $q->quote($db, $tbl);
PTDEBUG && _d('Checking', $db_tbl);
$self->{check_table_error} = undef;
my $sql = "SHOW TABLES FROM " . $q->quote($db)
. ' LIKE ' . $q->literal_like($tbl);
PTDEBUG && _d($sql);
@@ -313,8 +315,9 @@ sub check_table {
eval {
$row = $dbh->selectrow_arrayref($sql);
};
if ( $EVAL_ERROR ) {
PTDEBUG && _d($EVAL_ERROR);
if ( my $e = $EVAL_ERROR ) {
PTDEBUG && _d($e);
$self->{check_table_error} = $e;
return 0;
}
if ( !$row->[0] || $row->[0] ne $tbl ) {