1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-1510 GROUP BY supports functions with aggregation funcs as arguments in projections, e.g. sum(i)+1.

This commit is contained in:
Roman Nozdrin
2018-07-03 18:22:13 +03:00
committed by Roman Nozdrin
parent f53cc73517
commit cdd9bed1ae
5 changed files with 129 additions and 32 deletions

View File

@ -1170,6 +1170,46 @@ create_calpont_group_by_handler(THD* thd, Query* query)
return handler;
}
/***********************************************************
* DESCRIPTION:
* GROUP BY handler constructor
* PARAMETERS:
* thd - THD pointer.
* query - Query describing structure
***********************************************************/
ha_calpont_group_by_handler::ha_calpont_group_by_handler(THD* thd_arg, Query* query)
: group_by_handler(thd_arg, calpont_hton),
select(query->select),
table_list(query->from),
distinct(query->distinct),
where(query->where),
group_by(query->group_by),
order_by(query->order_by),
having(query->having)
{
List_iterator_fast<Item> item_iter(*select);
Item* item;
char* str = NULL;
while((item = item_iter++))
{
String descr;
item->print(&descr, QT_ORDINARY);
str = new char[descr.length()+1];
strncpy(str, descr.ptr(), descr.length());
str[descr.length()] = '\0';
select_list_descr.push_back(str);
}
}
/***********************************************************
* DESCRIPTION:
* GROUP BY destructor
***********************************************************/
ha_calpont_group_by_handler::~ha_calpont_group_by_handler()
{
select_list_descr.delete_elements();
}
/***********************************************************
* DESCRIPTION:
* Makes the plan and prepares the data