Fix Auth Error server status

The mon_ping_or_connect_to_db resets the MYSQL handle which caused the
loss of the error message. Returning a new enumeration value for
authentication errors solves this problem.
This commit is contained in:
Markus Mäkelä
2020-02-28 15:36:43 +02:00
parent 96ba2da40c
commit 67fee60f80
3 changed files with 18 additions and 16 deletions

View File

@ -382,8 +382,8 @@ void MariaDBMonitor::update_server(MariaDBServer* server)
// The server is not running. Clear some of the bits. User-set bits and some long-term bits
// can stay.
server->clear_status(SERVER_DOWN_CLEAR_BITS);
auto conn_errno = mysql_errno(conn);
if (conn_errno == ER_ACCESS_DENIED_ERROR || conn_errno == ER_ACCESS_DENIED_NO_PASSWORD_ERROR)
if (conn_status == MONITOR_CONN_ACCESS_DENIED)
{
server->set_status(SERVER_AUTH_ERROR);
}