From 5451240f57bf17851d3f486b0c1c895748f479b7 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 7 Mar 2019 16:18:31 +0100 Subject: ANALYZE SELECT with PS fix --- sql/sql_prepare.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 94f87a88155..cb06dee0cd5 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2548,8 +2548,12 @@ static bool check_prepared_statement(Prepared_statement *stmt) { if (lex->describe || lex->analyze_stmt) { - if (!lex->result && - !(lex->result= new (stmt->mem_root) select_send(thd))) + /* + With EXPAIN (describe) and ANALYZE STATEMENT we ignore original + result sending class and always send special result set to the + client + */ + if (!(lex->result= new (stmt->mem_root) select_send(thd))) DBUG_RETURN(TRUE); List field_list; res= thd->prepare_explain_fields(lex->result, &field_list, -- cgit v1.2.1