Use close_mysql() for failed Monitor connections

This can potentially be a solution for issue 2321.
If the error during the failed connection creation is not generated
by the backend, disconnect closing the TCP connection.
pull/2360/head
René Cannaò 7 years ago
parent 2cefe2810c
commit 4bca7a3d5c

@ -906,7 +906,12 @@ bool MySQL_Monitor_State_Data::create_new_connection() {
}
if (myrc==NULL) {
mysql_error_msg=strdup(mysql_error(mysql));
mysql_close(mysql);
int myerrno=mysql_errno(mysql);
if (myerrno < 2000) {
mysql_close(mysql);
} else {
close_mysql(mysql);
}
mysql = NULL;
return false;
} else {

Loading…
Cancel
Save