1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

Fixed bug in HAVING when refering to RAND() through alias

(BUG 8216)
This commit is contained in:
monty@mysql.com
2005-02-07 18:13:57 +02:00
parent e7450d9781
commit 32f91f48e8
8 changed files with 126 additions and 29 deletions

View File

@@ -1758,9 +1758,12 @@ String *Item_func_elt::val_str(String *str)
void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array,
List<Item> &fields)
{
if (item->with_sum_func && item->type() != SUM_FUNC_ITEM)
if (item->type() != SUM_FUNC_ITEM &&
(item->with_sum_func ||
(item->used_tables() & PSEUDO_TABLE_BITS)))
item->split_sum_func(thd, ref_pointer_array, fields);
else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
else if (item->type() == SUM_FUNC_ITEM ||
(item->used_tables() && item->type() != REF_ITEM))
{
uint el= fields.elements;
ref_pointer_array[el]=item;