From e60fbf260f4b67907925bf637bc64516d401b42e Mon Sep 17 00:00:00 2001 From: Gagan Goel Date: Wed, 21 Aug 2019 13:21:12 -0400 Subject: [PATCH] Disable processing of a union in a subquery by the select_handler --- dbcon/mysql/ha_mcs_pushdown.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dbcon/mysql/ha_mcs_pushdown.cpp b/dbcon/mysql/ha_mcs_pushdown.cpp index 713b70145..9d3b6d79a 100644 --- a/dbcon/mysql/ha_mcs_pushdown.cpp +++ b/dbcon/mysql/ha_mcs_pushdown.cpp @@ -462,6 +462,16 @@ create_columnstore_select_handler(THD* thd, SELECT_LEX* select_lex) return handler; } + // Disable SH processing for UNION in a subquery. + // This way, the server falls back to using the DH for executing + // the UNION, if enabled. + TABLE_LIST *tbl_ptr = select_lex->get_table_list(); + if (tbl_ptr && tbl_ptr->derived && + (tbl_ptr->derived->is_unit_op() || tbl_ptr->derived->fake_select_lex)) + { + return handler; + } + bool unsupported_feature = false; // Select_handler use the short-cut that effectively disables // INSERT..SELECT and LDI