MXS-2644 Log reason if mysql_real_connect fails
If mysql_real_connect fails inside any of the open_conn_db... utility functions that will now be logged.
This commit is contained in:
@ -84,7 +84,7 @@ int Mariadb_nodes::connect(int i, const std::string& db)
|
||||
nodes[i] = open_conn_db_timeout(port[i], IP[i], db.c_str(), user_name, password, 50, ssl);
|
||||
}
|
||||
|
||||
if ((nodes[i] != NULL) && (mysql_errno(nodes[i]) != 0))
|
||||
if ((nodes[i] == NULL) || (mysql_errno(nodes[i]) != 0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -1015,8 +1015,7 @@ bool do_flush_hosts(MYSQL* conn)
|
||||
|
||||
int Mariadb_nodes::flush_hosts()
|
||||
{
|
||||
|
||||
if (this->nodes[0] == NULL && this->connect())
|
||||
if (this->nodes[0] == NULL && (this->connect() != 0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user