From 199e48b5672bf4ad4f6a970aae2993ed1229114e Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Sat, 10 Feb 2024 10:26:52 +0900 Subject: [PATCH] Fixed not to set CR_MALFORMED_PACKET to error if CR_SERVER_GONE_ERROR is already set Closes GH-11951. --- NEWS | 4 ++++ ext/mysqlnd/mysqlnd_wireprotocol.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 999fc1a25b5..2a7ebd0f970 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,10 @@ PHP NEWS . Fixed bug #75712 (getenv in php-fpm should not read $_ENV, $_SERVER). (Jakub Zelenka) +- MySQLnd: + . Fixed bug GH-11950 ([mysqlnd] Fixed not to set CR_MALFORMED_PACKET to error + if CR_SERVER_GONE_ERROR is already set). (Saki Takamachi) + - PGSQL: . Fixed bug GH-13354 (pg_execute/pg_send_query_params/pg_send_execute with null value passed by reference). (George Barbarosie) diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 30d7415d885..fed191c74fa 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -2488,8 +2488,10 @@ MYSQLND_METHOD(mysqlnd_protocol, send_command_handle_OK)( payload_decoder_factory->m.init_ok_packet(&ok_response); DBG_ENTER("mysqlnd_protocol::send_command_handle_OK"); if (FAIL == (ret = PACKET_READ(payload_decoder_factory->conn, &ok_response))) { - DBG_INF("Error while reading OK packet"); - SET_CLIENT_ERROR(error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet"); + if (error_info->error_no != CR_SERVER_GONE_ERROR) { + DBG_INF("Error while reading OK packet"); + SET_CLIENT_ERROR(error_info, CR_MALFORMED_PACKET, UNKNOWN_SQLSTATE, "Malformed packet"); + } goto end; } DBG_INF_FMT("OK from server");