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