From 5821a710725f6dc1744fe59ae23ff861ef8fa44d Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Wed, 12 Sep 2018 14:08:35 +0300 Subject: [PATCH] MCOL-1717 GROUP BY handler now processes only relevant queries. --- dbcon/mysql/ha_calpont.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbcon/mysql/ha_calpont.cpp b/dbcon/mysql/ha_calpont.cpp index 8e906dd42..51ede22d5 100644 --- a/dbcon/mysql/ha_calpont.cpp +++ b/dbcon/mysql/ha_calpont.cpp @@ -1156,8 +1156,11 @@ create_calpont_group_by_handler(THD* thd, Query* query) { ha_calpont_group_by_handler* handler = NULL; + // Create a handler if there is an agregate or a GROUP BY + // and if vtable was explicitly disabled. if ( thd->infinidb_vtable.vtable_state == THD::INFINIDB_DISABLE_VTABLE - && thd->variables.infinidb_vtable_mode == 0) + && thd->variables.infinidb_vtable_mode == 0 + && ( query->group_by || thd->lex->select_lex.with_sum_func) ) { handler = new ha_calpont_group_by_handler(thd, query);