From 4d528cc6b848d1158e6a82b1ffdc7bd84d775d99 Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Mon, 10 Feb 2020 10:20:03 +0000 Subject: [PATCH] MCOL-3766 EXPLAIN now doesn't execute query via SH thus doesn't fail every other run. --- dbcon/mysql/ha_mcs_pushdown.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dbcon/mysql/ha_mcs_pushdown.cpp b/dbcon/mysql/ha_mcs_pushdown.cpp index d267ad896..bd3b2cd44 100644 --- a/dbcon/mysql/ha_mcs_pushdown.cpp +++ b/dbcon/mysql/ha_mcs_pushdown.cpp @@ -883,8 +883,13 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex) { handler= new ha_columnstore_select_handler(thd, select_lex); mcs_handler_info mhi= mcs_handler_info(reinterpret_cast(handler), SELECT); - // this::table is the place for the result set - int rc= ha_cs_impl_pushdown_init(&mhi, handler->table); + // handler::table is the place for the result set + int rc= 0; + // Skip execution for EXPLAIN queries + if (!thd->lex->describe) + { + rc= ha_cs_impl_pushdown_init(&mhi, handler->table); + } // Return SH even if init fails b/c CS changed SELECT_LEX structures // with simplify_joins_()