diff options
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 037bb60de3d..d5d8e6eeb1d 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -597,16 +597,19 @@ null: return 0; } -void Item_func_concat_ws::split_sum_func(List<Item> &fields) +void Item_func_concat_ws::split_sum_func(Item **ref_pointer_array, + List<Item> &fields) { if (separator->with_sum_func && separator->type() != SUM_FUNC_ITEM) - separator->split_sum_func(fields); + separator->split_sum_func(ref_pointer_array, fields); else if (separator->used_tables() || separator->type() == SUM_FUNC_ITEM) { + uint el= fields.elements; fields.push_front(separator); - separator= new Item_ref((Item**) fields.head_ref(), 0, separator->name); - } - Item_str_func::split_sum_func(fields); + ref_pointer_array[el]= separator; + separator= new Item_ref(ref_pointer_array + el, 0, separator->name); + } + Item_str_func::split_sum_func(ref_pointer_array, fields); } void Item_func_concat_ws::fix_length_and_dec() @@ -1583,16 +1586,19 @@ void Item_func_elt::fix_length_and_dec() } -void Item_func_elt::split_sum_func(List<Item> &fields) +void Item_func_elt::split_sum_func(Item **ref_pointer_array, + List<Item> &fields) { if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) - item->split_sum_func(fields); + item->split_sum_func(ref_pointer_array, fields); else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { + uint el= fields.elements; fields.push_front(item); - item= new Item_ref((Item**) fields.head_ref(), 0, item->name); - } - Item_str_func::split_sum_func(fields); + ref_pointer_array[el]= item; + item= new Item_ref(ref_pointer_array + el, 0, item->name); + } + Item_str_func::split_sum_func(ref_pointer_array, fields); } @@ -1642,16 +1648,19 @@ String *Item_func_elt::val_str(String *str) } -void Item_func_make_set::split_sum_func(List<Item> &fields) +void Item_func_make_set::split_sum_func(Item **ref_pointer_array, + List<Item> &fields) { if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) - item->split_sum_func(fields); + item->split_sum_func(ref_pointer_array, fields); else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { + uint el= fields.elements; fields.push_front(item); - item= new Item_ref((Item**) fields.head_ref(), 0, item->name); - } - Item_str_func::split_sum_func(fields); + ref_pointer_array[el]= item; + item= new Item_ref(ref_pointer_array + el, 0, item->name); + } + Item_str_func::split_sum_func(ref_pointer_array, fields); } |