From f4f053dd8cb5e09a94f6eba58b5da2e71f6d88dd Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Tue, 23 Apr 2019 14:34:49 +0300 Subject: [PATCH] MCOL-3267 CS now executes sorting inside UNION ALL sub-selects. --- dbcon/mysql/ha_calpont_execplan.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index 1094ffc37..7b33f4318 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -7138,7 +7138,9 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i // for subquery, order+limit by will be supported in infinidb. build order by columns // @todo union order by and limit support - if (gwi.hasWindowFunc || gwi.subSelectType != CalpontSelectExecutionPlan::MAIN_SELECT) + if (gwi.hasWindowFunc + || gwi.subSelectType != CalpontSelectExecutionPlan::MAIN_SELECT + || ( isUnion && ordercol )) { for (; ordercol; ordercol = ordercol->next) {