mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 06:00:14 +00:00
Add Cxn::lost_connection(). Rename runtime to run_time in Runtime.pm.
This commit is contained in:
@@ -173,6 +173,15 @@ sub set_dbh {
|
||||
return $dbh;
|
||||
}
|
||||
|
||||
sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/;
|
||||
# The 1st pattern means that MySQL itself died or was stopped.
|
||||
# The 2nd pattern means that our cxn was killed (KILL <id>).
|
||||
}
|
||||
|
||||
# Sub: dbh
|
||||
# Return the cxn's dbh.
|
||||
sub dbh {
|
||||
|
Reference in New Issue
Block a user