Fix monitor connection error messages
The connection is closed by the ping_or_connect_to_db function which causes the information about why the connection failed to be lost.
This commit is contained in:
@ -208,7 +208,8 @@ bool xpand::ping_or_connect_to_hub(const char* zName,
|
||||
MYSQL** ppCon)
|
||||
{
|
||||
bool connected = false;
|
||||
MonitorServer::ConnectResult rv = Monitor::ping_or_connect_to_db(settings, server, ppCon);
|
||||
std::string err;
|
||||
MonitorServer::ConnectResult rv = Monitor::ping_or_connect_to_db(settings, server, ppCon, &err);
|
||||
|
||||
if (Monitor::connection_is_ok(rv))
|
||||
{
|
||||
@ -229,7 +230,7 @@ bool xpand::ping_or_connect_to_hub(const char* zName,
|
||||
else
|
||||
{
|
||||
MXS_ERROR("%s: Could either not ping or create connection to %s:%d: %s",
|
||||
zName, server.address, server.port, mysql_error(*ppCon));
|
||||
zName, server.address, server.port, err.c_str());
|
||||
}
|
||||
|
||||
return connected;
|
||||
|
Reference in New Issue
Block a user