mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-05 20:07:54 +00:00
PT-2295 - Fix tests on distributions
- Added regular expressions that match MariaDB Connector/C syntax for errors 2006 (Server has gone away) and 2013 (Lost connection)
This commit is contained in:
@@ -4728,7 +4728,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
@@ -2433,7 +2433,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
@@ -2777,7 +2777,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
@@ -1931,7 +1931,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
10
bin/pt-kill
10
bin/pt-kill
@@ -5543,7 +5543,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
@@ -7177,7 +7179,11 @@ sub main {
|
||||
# The 1st pattern means that MySQL itself died or was stopped.
|
||||
# The 2nd pattern means that our cxn was killed (KILL <id>).
|
||||
if ( $error =~ m/MySQL server has gone away/
|
||||
|| $error =~ m/Server has gone away/
|
||||
|| $error =~ m/Lost connection to server/
|
||||
|| $error =~ m/Lost connection to MySQL server/ ) {
|
||||
eval {
|
||||
eval {
|
||||
eval {
|
||||
$dbh = $cxn->connect();
|
||||
$proc_sth = $dbh->prepare('SHOW FULL PROCESSLIST');
|
||||
@@ -7210,6 +7216,8 @@ sub main {
|
||||
# The 1st pattern means that MySQL itself died or was stopped.
|
||||
# The 2nd pattern means that our cxn was killed (KILL <id>).
|
||||
if ( $error =~ m/MySQL server has gone away/
|
||||
|| $error =~ m/Server has gone away/
|
||||
|| $error =~ m/Lost connection to server/
|
||||
|| $error =~ m/Lost connection to MySQL server/ ) {
|
||||
eval {
|
||||
$dbh = $cxn->connect();
|
||||
@@ -7299,6 +7307,8 @@ sub main {
|
||||
# The 1st pattern means that MySQL itself died or was stopped.
|
||||
# The 2nd pattern means that our cxn was killed (KILL <id>).
|
||||
if ( $error =~ m/MySQL server has gone away/
|
||||
|| $error =~ m/Server has gone away/
|
||||
|| $error =~ m/Lost connection to server/
|
||||
|| $error =~ m/Lost connection to MySQL server/ ) {
|
||||
eval {
|
||||
$log_dbh = $log_cxn->connect();
|
||||
|
@@ -4039,7 +4039,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
@@ -3738,7 +3738,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
@@ -2604,7 +2604,9 @@ sub lost_connection {
|
||||
my ($self, $e) = @_;
|
||||
return 0 unless $e;
|
||||
return $e =~ m/MySQL server has gone away/
|
||||
|| $e =~ m/Server has gone away/
|
||||
|| $e =~ m/Lost connection to MySQL server/
|
||||
|| $e =~ m/Lost connection to server/
|
||||
|| $e =~ m/Server shutdown in progress/;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user