From f40affc361e9c7129b2340ebd7d6d91821915e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Fri, 19 Feb 2016 10:30:53 +0000 Subject: [PATCH] Removed variable mysql-bug_mdev_8338 It seems that bug https://mariadb.atlassian.net/browse/MDEV-8338 is so severe that bypassing it from ProxySQL is not that easy. If affected by https://mariadb.atlassian.net/browse/MDEV-8338 , a user should disable mysql-multiplexing --- include/MySQL_Thread.h | 1 - include/mysql_connection.h | 3 --- include/proxysql_structs.h | 2 -- lib/MySQL_Thread.cpp | 18 ------------------ lib/mysql_connection.cpp | 26 +------------------------- 5 files changed, 1 insertion(+), 49 deletions(-) diff --git a/include/MySQL_Thread.h b/include/MySQL_Thread.h index ce624681b..2ff679cd1 100644 --- a/include/MySQL_Thread.h +++ b/include/MySQL_Thread.h @@ -272,7 +272,6 @@ class MySQL_Threads_Handler int connect_timeout_server_max; int free_connections_pct; bool sessions_sort; - bool bug_mdev_8338; char *default_schema; char *interfaces; char *server_version; diff --git a/include/mysql_connection.h b/include/mysql_connection.h index 70a39d384..b53ce9e7b 100644 --- a/include/mysql_connection.h +++ b/include/mysql_connection.h @@ -11,7 +11,6 @@ #define STATUS_MYSQL_CONNECTION_LOCK_TABLES 0x00000010 #define STATUS_MYSQL_CONNECTION_TEMPORARY_TABLE 0x00000020 #define STATUS_MYSQL_CONNECTION_GET_LOCK 0x00000040 -#define STATUS_MYSQL_CONNECTION_MDEV_8338 0x00000080 class MySQL_Connection_userinfo { private: @@ -93,7 +92,6 @@ class MySQL_Connection { void set_status_temporary_table(bool); void set_status_prepared_statement(bool); void set_status_user_variable(bool); - void set_status_bug_mdev_8338(bool); bool get_status_transaction(); bool get_status_compression(); bool get_status_get_lock(); @@ -101,7 +99,6 @@ class MySQL_Connection { bool get_status_temporary_table(); bool get_status_prepared_statement(); bool get_status_user_variable(); - bool get_status_bug_mdev_8338(); void connect_start(); void connect_cont(short event); void change_user_start(); diff --git a/include/proxysql_structs.h b/include/proxysql_structs.h index da04e767b..a8f916b4a 100644 --- a/include/proxysql_structs.h +++ b/include/proxysql_structs.h @@ -717,7 +717,6 @@ __thread bool mysql_thread___commands_stats; __thread bool mysql_thread___query_digests; __thread bool mysql_thread___default_reconnect; __thread bool mysql_thread___sessions_sort; -__thread bool mysql_thread___bug_mdev_8338; /* variables used by events log */ __thread char * mysql_thread___eventslog_filename; @@ -782,7 +781,6 @@ extern __thread bool mysql_thread___commands_stats; extern __thread bool mysql_thread___query_digests; extern __thread bool mysql_thread___default_reconnect; extern __thread bool mysql_thread___sessions_sort; -extern __thread bool mysql_thread___bug_mdev_8338; /* variables used by events log */ extern __thread char * mysql_thread___eventslog_filename; diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index 9996a8614..ddb222da3 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -182,7 +182,6 @@ static char * mysql_thread_variables_names[]= { (char *)"server_capabilities", (char *)"server_version", (char *)"sessions_sort", - (char *)"bug_mdev_8338", (char *)"commands_stats", (char *)"query_digests", (char *)"servers_stats", @@ -259,7 +258,6 @@ MySQL_Threads_Handler::MySQL_Threads_Handler() { variables.multiplexing=true; variables.query_digests=true; variables.sessions_sort=true; - variables.bug_mdev_8338=false; variables.servers_stats=true; variables.default_reconnect=true; #ifdef DEBUG @@ -408,7 +406,6 @@ int MySQL_Threads_Handler::get_variable_int(char *name) { if (!strcasecmp(name,"commands_stats")) return (int)variables.commands_stats; if (!strcasecmp(name,"query_digests")) return (int)variables.query_digests; if (!strcasecmp(name,"sessions_sort")) return (int)variables.sessions_sort; - if (!strcasecmp(name,"bug_mdev_8338")) return (int)variables.bug_mdev_8338; if (!strcasecmp(name,"servers_stats")) return (int)variables.servers_stats; if (!strcasecmp(name,"default_reconnect")) return (int)variables.default_reconnect; if (!strcasecmp(name,"poll_timeout")) return variables.poll_timeout; @@ -606,9 +603,6 @@ char * MySQL_Threads_Handler::get_variable(char *name) { // this is the public f if (!strcasecmp(name,"sessions_sort")) { return strdup((variables.sessions_sort ? "true" : "false")); } - if (!strcasecmp(name,"bug_mdev_8338")) { - return strdup((variables.bug_mdev_8338 ? "true" : "false")); - } if (!strcasecmp(name,"servers_stats")) { return strdup((variables.servers_stats ? "true" : "false")); } @@ -1127,17 +1121,6 @@ bool MySQL_Threads_Handler::set_variable(char *name, char *value) { // this is t } return false; } - if (!strcasecmp(name,"bug_mdev_8338")) { - if (strcasecmp(value,"true")==0 || strcasecmp(value,"1")==0) { - variables.bug_mdev_8338=true; - return true; - } - if (strcasecmp(value,"false")==0 || strcasecmp(value,"0")==0) { - variables.bug_mdev_8338=false; - return true; - } - return false; - } if (!strcasecmp(name,"servers_stats")) { if (strcasecmp(value,"true")==0 || strcasecmp(value,"1")==0) { variables.servers_stats=true; @@ -1821,7 +1804,6 @@ void MySQL_Thread::refresh_variables() { mysql_thread___commands_stats=(bool)GloMTH->get_variable_int((char *)"commands_stats"); mysql_thread___query_digests=(bool)GloMTH->get_variable_int((char *)"query_digests"); mysql_thread___sessions_sort=(bool)GloMTH->get_variable_int((char *)"sessions_sort"); - mysql_thread___bug_mdev_8338=(bool)GloMTH->get_variable_int((char *)"bug_mdev_8338"); mysql_thread___servers_stats=(bool)GloMTH->get_variable_int((char *)"servers_stats"); mysql_thread___default_reconnect=(bool)GloMTH->get_variable_int((char *)"default_reconnect"); #ifdef DEBUG diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 974982f34..b24278244 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -269,15 +269,6 @@ void MySQL_Connection::set_status_prepared_statement(bool v) { } } -// this function disables multiplexing because of bug https://mariadb.atlassian.net/browse/MDEV-8338 -void MySQL_Connection::set_status_bug_mdev_8338(bool v) { - if (v) { - status_flags |= STATUS_MYSQL_CONNECTION_MDEV_8338; - } else { - status_flags &= ~STATUS_MYSQL_CONNECTION_MDEV_8338; - } -} - bool MySQL_Connection::get_status_transaction() { return status_flags & STATUS_MYSQL_CONNECTION_TRANSACTION; } @@ -306,10 +297,6 @@ bool MySQL_Connection::get_status_prepared_statement() { return status_flags & STATUS_MYSQL_CONNECTION_PREPARED_STATEMENT; } -bool MySQL_Connection::get_status_bug_mdev_8338() { - return status_flags & STATUS_MYSQL_CONNECTION_MDEV_8338; -} - // non blocking API void MySQL_Connection::connect_start() { PROXY_TRACE(); @@ -1050,7 +1037,7 @@ bool MySQL_Connection::MultiplexDisabled() { // status_flags stores information about the status of the connection // can be used to determine if multiplexing can be enabled or not bool ret=false; - if (status_flags & (STATUS_MYSQL_CONNECTION_TRANSACTION|STATUS_MYSQL_CONNECTION_USER_VARIABLE|STATUS_MYSQL_CONNECTION_PREPARED_STATEMENT|STATUS_MYSQL_CONNECTION_LOCK_TABLES|STATUS_MYSQL_CONNECTION_TEMPORARY_TABLE|STATUS_MYSQL_CONNECTION_GET_LOCK|STATUS_MYSQL_CONNECTION_MDEV_8338) ) { + if (status_flags & (STATUS_MYSQL_CONNECTION_TRANSACTION|STATUS_MYSQL_CONNECTION_USER_VARIABLE|STATUS_MYSQL_CONNECTION_PREPARED_STATEMENT|STATUS_MYSQL_CONNECTION_LOCK_TABLES|STATUS_MYSQL_CONNECTION_TEMPORARY_TABLE|STATUS_MYSQL_CONNECTION_GET_LOCK) ) { ret=true; } return ret; @@ -1090,17 +1077,6 @@ void MySQL_Connection::ProcessQueryAndSetStatusFlags(char *query_digest_text) { set_status_get_lock(true); } } - if (mysql_thread___bug_mdev_8338) { - if (get_status_bug_mdev_8338()==false) { // we only analyze the queries if the flag isn't set already - if ( - strcasestr(query_digest_text,"NOW()") - || - strcasestr(query_digest_text,"CURDATE()") - ) { - set_status_bug_mdev_8338(true); - } - } - } } void MySQL_Connection::optimize() {