From 6d7fe8520a938d92a6a7b0e569e8f56d926936ac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 20:06:06 +0300 Subject: Merging fix for BUG#6976 from 4.0 to 4.1 The problem in 4.1 was the same as in 4.0 - fix_fields() not called for created Item_ref. The fix is similar too - initialize Item_refs in ctor (but don't interfere with cases when Item_ref is used by subselects). sql/item.cc: Fix for BUG#6976 ported from 4.0 sql/item_cmpfunc.cc: Fix for BUG#6976 ported from 4.0 sql/item_func.cc: Fix for BUG#6976 ported from 4.0 sql/item_row.cc: Fix for BUG#6976 ported from 4.0 sql/item_strfunc.cc: Fix for BUG#6976 ported from 4.0 --- sql/item_row.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/item_row.cc') diff --git a/sql/item_row.cc b/sql/item_row.cc index 289efe45300..b65b0b7b608 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -95,7 +95,8 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name, + *arg); fields.push_front(*arg); ref_pointer_array[el]= *arg; thd->change_item_tree(arg, new_item); -- cgit v1.2.1