From 86cc7cd3daee229346d45e63023e1a7a2164712b Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 6 Dec 2025 05:50:29 +0000 Subject: [PATCH] session: Fix wait_timeout member variable declaration and usage - Add wait_timeout member variable declaration to Base_Session class - Fix constructor initialization to use this->wait_timeout - Fix assignment in handler to properly scope member variable - Resolves compilation error for wait_timeout functionality --- include/Base_Session.h | 1 + lib/MySQL_Session.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/Base_Session.h b/include/Base_Session.h index a5883ce92..3d13a15b3 100644 --- a/include/Base_Session.h +++ b/include/Base_Session.h @@ -77,6 +77,7 @@ class Base_Session { int transaction_persistent_hostgroup; int to_process; enum proxysql_session_type session_type; + int wait_timeout; //in milliseconds // bool bool autocommit; diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index e6a491b87..1cc3dbd35 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -684,7 +684,7 @@ MySQL_Session::MySQL_Session() { last_HG_affected_rows = -1; // #1421 : advanced support for LAST_INSERT_ID() proxysql_node_address = NULL; use_ldap_auth = false; - wait_timeout = mysql_thread___wait_timeout; + this->wait_timeout = mysql_thread___wait_timeout; backend_closed_in_fast_forward = false; fast_forward_grace_start_time = 0; } @@ -6622,8 +6622,8 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C mysql_thread___wait_timeout); } - if (wait_timeout != client_timeout) { - wait_timeout = client_timeout; + if (this->wait_timeout != client_timeout) { + this->wait_timeout = client_timeout; proxy_debug(PROXY_DEBUG_MYSQL_COM, 8, "Changing connection wait_timeout to %llu ms\n", client_timeout); } } else if (var == "tx_isolation") {