Store capabilities of monitored server

Checking the version number in various places in the code gets confusing.
It's better to check the version in one place and record the relevant data.
This commit is contained in:
Esa Korhonen
2018-11-19 16:11:32 +02:00
parent 01628dd0de
commit fb52e565fe
5 changed files with 78 additions and 68 deletions

View File

@ -357,10 +357,8 @@ void MariaDBMonitor::update_server(MariaDBServer* server)
server->update_server_version();
}
auto server_vrs = server->m_version;
if (server_vrs == MariaDBServer::version::MARIADB_MYSQL_55
|| server_vrs == MariaDBServer::version::MARIADB_100
|| server_vrs == MariaDBServer::version::BINLOG_ROUTER)
if (server->m_capabilities.basic_support
|| server->m_srv_type == MariaDBServer::server_type::BINLOG_ROUTER)
{
// Check permissions if permissions failed last time or if this is a new connection.
if (server->had_status(SERVER_AUTH_ERROR) || conn_status == MONITOR_CONN_NEWCONN_OK)