1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-11 15:22:09 +03:00

Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt

into  moonbone.local:/work/20503-bug-5.0-mysql
This commit is contained in:
evgen@moonbone.local
2006-09-29 21:22:47 +04:00
3 changed files with 28 additions and 1 deletions

View File

@ -13513,7 +13513,19 @@ bool JOIN::alloc_func_list()
disctinct->group_by optimization
*/
if (select_distinct)
{
group_parts+= fields_list.elements;
/*
If the ORDER clause is specified then it's possible that
it also will be optimized, so reserve space for it too
*/
if (order)
{
ORDER *ord;
for (ord= order; ord; ord= ord->next)
group_parts++;
}
}
/* This must use calloc() as rollup_make_fields depends on this */
sum_funcs= (Item_sum**) thd->calloc(sizeof(Item_sum**) * (func_count+1) +