merged pt-table-sync-fails-to-close-one-db-handle-1401399

This commit is contained in:
Frank Cizmich
2015-04-09 13:23:24 -03:00
+6
View File
@@ -11039,6 +11039,12 @@ sub disconnect {
my $dbh = $host->{$thing};
next unless $dbh;
delete $dsn_for{$dbh};
# The following is for when misc_dbh loses
# connection due to timeout. Since it has nothing
# to commit we avoid reporting an error.
if ( $thing eq 'misc_dbh' && !$dbh->ping() ) {
next;
}
$dbh->commit() unless $dbh->{AutoCommit};
$dbh->disconnect();
PTDEBUG && _d('Disconnected dbh', $dbh);