From 65870492bec2bc73d133eb3f9af03d47554c6dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Thu, 18 Feb 2021 16:04:46 +0000 Subject: [PATCH] Removed hardcoded values for error codes in counters in 'monitor_connect_thread' and no longer required include --- lib/MySQL_Monitor.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 6aabc1be6..3ae7e0774 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -11,7 +11,6 @@ #include #include #include -#include "mysqld_error.h" #include "MySQL_Protocol.h" #include "MySQL_HostGroups_Manager.h" #include "MySQL_Monitor.hpp" @@ -874,13 +873,12 @@ void * monitor_connect_thread(void *arg) { (strncmp(mmsd->mysql_error_msg,"ProxySQL Error: Access denied for user",strlen("ProxySQL Error: Access denied for user"))==0) ) { proxy_error("Server %s:%d is returning \"Access denied\" for monitoring user\n", mmsd->hostname, mmsd->port); - MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, mmsd->hostgroup_id, mmsd->hostname, mmsd->port, ER_ACCESS_DENIED_ERROR); } else if (strncmp(mmsd->mysql_error_msg,"Your password has expired.",strlen("Your password has expired."))==0) { proxy_error("Server %s:%d is returning \"Your password has expired.\" for monitoring user\n", mmsd->hostname, mmsd->port); - MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, mmsd->hostgroup_id, mmsd->hostname, mmsd->port, ER_MUST_CHANGE_PASSWORD_LOGIN); } + MyHGM->p_update_mysql_error_counter(p_mysql_error_type::proxysql, mmsd->hostgroup_id, mmsd->hostname, mmsd->port, mysql_errno(mmsd->mysql)); } else { connect_success = true; }