From d963232ce06bbf7df6c0027282ad6fa99aa3f73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 6 Mar 2025 15:16:05 +0000 Subject: [PATCH] Ignore tracking of session_track_system_variables Adding variable session_track_system_variables to `ignore_vars` Also added `@@session.` and `@@global.` in the parser for SET statements (parse1v2) See issue #4839 --- lib/MySQL_Variables.cpp | 2 ++ lib/set_parser.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Variables.cpp b/lib/MySQL_Variables.cpp index c0df46782..5b2cd406d 100644 --- a/lib/MySQL_Variables.cpp +++ b/lib/MySQL_Variables.cpp @@ -52,6 +52,8 @@ MySQL_Variables::MySQL_Variables() { ignore_vars.push_back("read_rnd_buffer_size"); // NOTE: This variable has been temporarily ignored. Check issues #3442 and #3441. ignore_vars.push_back("session_track_schema"); + // NOTE: This variable has been temporarily ignored. Check issues #4839 + ignore_vars.push_back("session_track_system_variables"); variables_regexp = ""; for (auto i = 0; i < SQL_NAME_LAST_HIGH_WM; i++) { // we initialized all the internal_variable_name if set to NULL diff --git a/lib/set_parser.cpp b/lib/set_parser.cpp index 012f85fc4..adbd5586b 100644 --- a/lib/set_parser.cpp +++ b/lib/set_parser.cpp @@ -158,7 +158,7 @@ void SetParser::generateRE_parse1v2() { // - variable name , with double @ (session variable) or single @ (user defiend variable) // - strings that includes words, spaces and commas // - single quote string - string sw0 = "(?:\\w+|\"[\\w, ]+\"|\'[\\w, ]+\'|@(?:|@)\\w+|\'\')"; + string sw0 = "(?:\\w+|\"[\\w, ]+\"|\'[\\w, ]+\'|@(?:|@|@session\\.|@global\\.)\\w+|\'\')"; string mw0 = "(?:" + sw0 + "(?: *, *" + sw0 + ")*)"; // multiple words, separated by comma and random spaces string fww = "(?:(?:REPLACE|IFNULL|CONCAT)\\( *" + mw0 + "\\))"; // functions REPLACE|IFNULL|CONCAT having argument multiple words string rfww2 = "(?:(?:REPLACE|IFNULL|CONCAT)\\( *" + fww + " *, *" + mw0 + "\\))"; //functions REPLACE|IFNULL|CONCAT calling the same functions