From 4e1ba8da319eac6502b9517d04a9728a3df40476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Tue, 13 Dec 2022 14:34:44 +0100 Subject: [PATCH] Remove 'SERVER_SESSION_STATE_CHANGED' only when not GTID related #4023 --- lib/MySQL_Protocol.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/MySQL_Protocol.cpp b/lib/MySQL_Protocol.cpp index faab94097..642a2979e 100644 --- a/lib/MySQL_Protocol.cpp +++ b/lib/MySQL_Protocol.cpp @@ -533,8 +533,10 @@ 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; + if (gtid_len == 0) { + // Remove 'SERVER_SESSION_STATE_CHANGED', since we don't track this info unless GTID related + 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)) {