From e6e0041b18f2d645858de42cdb1cb90eca60b158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 26 Nov 2017 00:28:08 +0100 Subject: [PATCH] In Admin, filter commands specific to MySQL and/or transactions #1047 --- lib/ProxySQL_Admin.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index a061c5450..a5f9548e9 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -2407,6 +2407,29 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) { goto __run_query; } + // fix bug #1047 + if ( + (!strncasecmp("BEGIN", query_no_space, strlen("BEGIN"))) + || + (!strncasecmp("START TRANSACTION", query_no_space, strlen("START TRANSACTION"))) + || + (!strncasecmp("COMMIT", query_no_space, strlen("COMMIT"))) + || + (!strncasecmp("ROLLBACK", query_no_space, strlen("ROLLBACK"))) + || + (!strncasecmp("SET character_set_results", query_no_space, strlen("SET character_set_results"))) + || + (!strncasecmp("SET SQL_AUTO_IS_NULL", query_no_space, strlen("SET SQL_AUTO_IS_NULL"))) + || + (!strncasecmp("SET NAMES", query_no_space, strlen("SET NAMES"))) + || + (!strncasecmp("SET AUTOCOMMIT", query_no_space, strlen("SET AUTOCOMMIT"))) + ) { + SPA->send_MySQL_OK(&sess->client_myds->myprot, NULL); + run_query=false; + goto __run_query; + } + if (query_no_space_length==SELECT_VERSION_COMMENT_LEN) { if (!strncasecmp(SELECT_VERSION_COMMENT, query_no_space, query_no_space_length)) { l_free(query_length,query);