diff options
author | unknown <bell@sanja.is.com.ua> | 2005-06-17 17:27:47 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-06-17 17:27:47 +0300 |
commit | 467ca505b5c5cb6f1512fc3425fd0f0b8620c099 (patch) | |
tree | a1524e75158ce5df834d60837e8609e95d3b7d3f /sql/item_sum.cc | |
parent | 04cc7cdef7dc0c6dbb60821f3d2ab7ff0497074c (diff) | |
download | mariadb-git-467ca505b5c5cb6f1512fc3425fd0f0b8620c099.tar.gz |
fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387)
mysql-test/r/view.result:
using sum(distinct ), cast(... as decimal) & avg(distinct ) in views
mysql-test/t/view.test:
using sum(distinct ), cast(... as decimal) & avg(distinct ) in views
sql/item.h:
Add a comment for Item::print
sql/item_func.cc:
Use functype(), not func_name() for item equvalence detection
sql/item_func.h:
Missed function typoes added
Add a comment for Item_func::func_name()
style fix
sql/item_strfunc.cc:
Use functype(), not func_name() for item equvalence detection
sql/item_strfunc.h:
Add missing func_name and func_type
sql/item_sum.cc:
Item_sum func_name report beggining of function till first argument
sql/item_sum.h:
Item_sum func_name report beggining of function till first argument
sql/item_timefunc.cc:
Use functype(), not func_name() for item equvalence detection
sql/item_timefunc.h:
Add missing func_name and func_type
sql/item_uniq.h:
Add missing func_name
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index f7a158ceb5a..76f94801b49 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -86,7 +86,6 @@ void Item_sum::make_field(Send_field *tmp_field) void Item_sum::print(String *str) { str->append(func_name()); - str->append('('); for (uint i=0 ; i < arg_count ; i++) { if (i) @@ -2425,13 +2424,6 @@ longlong Item_sum_count_distinct::val_int() } -void Item_sum_count_distinct::print(String *str) -{ - str->append("count(distinct ", 15); - args[0]->print(str); - str->append(')'); -} - /**************************************************************************** ** Functions to handle dynamic loadable aggregates ** Original source by: Alexis Mikhailov <root@medinf.chuvashia.su> @@ -2466,6 +2458,20 @@ void Item_udf_sum::cleanup() } +void Item_udf_sum::print(String *str) +{ + str->append(func_name()); + str->append('('); + for (uint i=0 ; i < arg_count ; i++) + { + if (i) + str->append(','); + args[i]->print(str); + } + str->append(')'); +} + + Item *Item_sum_udf_float::copy_or_same(THD* thd) { return new (thd->mem_root) Item_sum_udf_float(thd, this); |