summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-02-04 21:52:14 +0200
committermonty@mashka.mysql.fi <>2003-02-04 21:52:14 +0200
commit023d6dd39b9068ab8096c5ec60ab82bd10dbcee2 (patch)
treebad5f8dd7f020cc76a4c5e0f19bd130e3fb4a735 /sql/item_strfunc.cc
parent6a32ae735541b4780a209e883430ded343115792 (diff)
parent5ce0cd16b8b9fa05c781ac6ff4687133ed145d84 (diff)
downloadmariadb-git-023d6dd39b9068ab8096c5ec60ab82bd10dbcee2.tar.gz
Merge with 4.0.11
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 73f2968c5f6..037bb60de3d 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -597,6 +597,17 @@ null:
return 0;
}
+void Item_func_concat_ws::split_sum_func(List<Item> &fields)
+{
+ if (separator->with_sum_func && separator->type() != SUM_FUNC_ITEM)
+ separator->split_sum_func(fields);
+ else if (separator->used_tables() || separator->type() == SUM_FUNC_ITEM)
+ {
+ fields.push_front(separator);
+ separator= new Item_ref((Item**) fields.head_ref(), 0, separator->name);
+ }
+ Item_str_func::split_sum_func(fields);
+}
void Item_func_concat_ws::fix_length_and_dec()
{
@@ -610,6 +621,7 @@ void Item_func_concat_ws::fix_length_and_dec()
}
used_tables_cache|=separator->used_tables();
const_item_cache&=separator->const_item();
+ with_sum_func= with_sum_func || separator->with_sum_func;
}
void Item_func_concat_ws::update_used_tables()
@@ -1571,6 +1583,19 @@ void Item_func_elt::fix_length_and_dec()
}
+void Item_func_elt::split_sum_func(List<Item> &fields)
+{
+ if (item->with_sum_func && item->type() != SUM_FUNC_ITEM)
+ item->split_sum_func(fields);
+ else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
+ {
+ fields.push_front(item);
+ item= new Item_ref((Item**) fields.head_ref(), 0, item->name);
+ }
+ Item_str_func::split_sum_func(fields);
+}
+
+
void Item_func_elt::update_used_tables()
{
Item_func::update_used_tables();
@@ -1617,6 +1642,19 @@ String *Item_func_elt::val_str(String *str)
}
+void Item_func_make_set::split_sum_func(List<Item> &fields)
+{
+ if (item->with_sum_func && item->type() != SUM_FUNC_ITEM)
+ item->split_sum_func(fields);
+ else if (item->used_tables() || item->type() == SUM_FUNC_ITEM)
+ {
+ fields.push_front(item);
+ item= new Item_ref((Item**) fields.head_ref(), 0, item->name);
+ }
+ Item_str_func::split_sum_func(fields);
+}
+
+
void Item_func_make_set::fix_length_and_dec()
{
max_length=arg_count-1;
@@ -1624,6 +1662,7 @@ void Item_func_make_set::fix_length_and_dec()
max_length+=args[i]->max_length;
used_tables_cache|=item->used_tables();
const_item_cache&=item->const_item();
+ with_sum_func= with_sum_func || item->with_sum_func;
}