From 44db6ffc192a3cca61be3fc2c1e977821ad2f733 Mon Sep 17 00:00:00 2001 From: Dmitry Shulga Date: Thu, 17 Jun 2021 14:53:22 +0700 Subject: [PATCH] MDEV-16708: fixed failure of the test sys_vars.sql_select_limit_func This test failed in case it was run in PS mode and for embedded server The reason of test failure was that the following fields affected_row, server_status, insert_id of the structure MYSQL_STMT weren't update on calling mysql_stmt_next_result() in case combination of binary protocol and embedded server used. --- libmysqld/libmysql.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libmysqld/libmysql.c b/libmysqld/libmysql.c index fbfe8b683c0..7a0843d32e5 100644 --- a/libmysqld/libmysql.c +++ b/libmysqld/libmysql.c @@ -4936,6 +4936,12 @@ int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt) alloc_stmt_fields(stmt); prepare_to_fetch_result(stmt); } + else + { + stmt->affected_rows= stmt->mysql->affected_rows; + stmt->server_status= stmt->mysql->server_status; + stmt->insert_id= stmt->mysql->insert_id; + } DBUG_RETURN(0); }