From b66f23fcbdee87c84c8bd05c7c9c2da626a12a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 27 Jan 2023 10:56:49 +0100 Subject: [PATCH] Improve comments for 'MYSQL_COM_BINLOG_DUMP' session preparation --- lib/MySQL_Session.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 3030ff36cb..56a9ac8749 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -4012,6 +4012,8 @@ int MySQL_Session::get_pkts_from_client(bool& wrong_pass, PtrSize_t& pkt) { // handle the command automatically. mybe = find_or_create_backend(current_hostgroup); // set a backend mybe->server_myds->reinit_queues(); // reinitialize the queues in the myds . By default, they are not active + // We reinitialize the 'wait_until' since this session shouldn't wait for processing as + // we are now transitioning to 'FAST_FORWARD'. mybe->server_myds->wait_until = 0; if (mybe->server_myds->DSS==STATE_NOT_INITIALIZED) { // NOTE: This section is entirely borrowed from 'STATE_SLEEP' for 'session_fast_forward'. @@ -4031,7 +4033,10 @@ int MySQL_Session::get_pkts_from_client(bool& wrong_pass, PtrSize_t& pkt) { previous_status.push(FAST_FORWARD); // next status will be FAST_FORWARD set_status(CONNECTING_SERVER); // now we need a connection } else { - // we have a connection + // In case of having a connection, we need to make user to reset the state machine + // for current server 'MySQL_Data_Stream', setting it outside of any state handled + // by 'mariadb' library. Otherwise 'MySQL_Thread' will threat this + // 'MySQL_Data_Stream' as library handled. mybe->server_myds->DSS = STATE_READY; set_status(FAST_FORWARD); // we can set status to FAST_FORWARD }