From 5d585837d8c12b7bb0d4f72bbec86d796205fdb2 Mon Sep 17 00:00:00 2001 From: Gagan Goel Date: Thu, 3 Oct 2019 16:12:06 -0400 Subject: [PATCH] Allow a window function in the ORDER BY clause. --- dbcon/mysql/ha_calpont_execplan.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index 2eda37ba7..61c37a837 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -361,9 +361,10 @@ bool sortItemIsInGrouping(Item* sort_item, ORDER* groupcol) Item_func *ifp = reinterpret_cast(sort_item); ifp->traverse_cond(check_sum_func_item, &found, Item::POSTFIX); } - else if (sort_item->type() == Item::CONST_ITEM) + else if (sort_item->type() == Item::CONST_ITEM || + sort_item->type() == Item::WINDOW_FUNC_ITEM) { - found= true; + found = true; } for (; !found && groupcol; groupcol = groupcol->next)