From 2bbeba1845bf109e0ec6e0d32e182eea6b3a76a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 25 Nov 2022 17:03:20 +0100 Subject: [PATCH] Fix forwarding of 'SERVER_SESSION_STATE_CHANGED' status to clients #4023 Right now server session state isn't tracked for backend connections, so we don't include this information in the generated OK packet. Because of this, we should never report of this status change to clients. --- lib/MySQL_Protocol.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index 27caba7ca..436aba5c6 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -533,6 +533,8 @@ bool MySQL_Protocol::generate_pkt_OK(bool send, void **ptr, unsigned int *len, u internal_status |= SERVER_STATUS_NO_BACKSLASH_ESCAPES; } } + // Always remove 'SERVER_SESSION_STATE_CHANGED', since we don't track this information right now + internal_status &= ~SERVER_SESSION_STATE_CHANGED; memcpy(_ptr+l, &internal_status, sizeof(uint16_t)); l+=sizeof(uint16_t); memcpy(_ptr+l, &warnings, sizeof(uint16_t)); l+=sizeof(uint16_t); if (msg && strlen(msg)) {