From 21989e7d4e281b67f060d61fdd0dd4fa2b4eba54 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Jun 2005 07:27:02 -0700 Subject: item_func.h: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. The str_op virtual method was added into Item_func_numhybrid. item_func.cc: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. The str_op virtual method was added into Item_func_numhybrid. item_cmpfunc.h, item_cmpfunc.cc: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. Item_func_coalesce and Item_func_ifnull now inherit from a modified Item_func_numhybrid. case.test, case.result: Added test cases for bug #9939. mysql-test/r/case.result: Added test cases for bug #9939. mysql-test/t/case.test: Added test cases for bug #9939. sql/item_cmpfunc.cc: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. Item_func_coalesce and Item_func_ifnull now inherit from a modified Item_func_numhybrid. sql/item_cmpfunc.h: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. Item_func_coalesce and Item_func_ifnull now inherit from a modified Item_func_numhybrid. sql/item_func.cc: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. The str_op virtual method was added into Item_func_numhybrid. sql/item_func.h: Fixed bug #9939: a wrong conversion of arguments for functions COALESCE and IFNULL. he str_op virtual method was added into Item_func_numhybrid. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- sql/item_cmpfunc.h | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'sql/item_cmpfunc.h') diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index a929d509723..7a22e76b217 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -453,23 +453,19 @@ public: }; -class Item_func_coalesce :public Item_func +class Item_func_coalesce :public Item_func_numhybrid { protected: - enum Item_result cached_result_type; - Item_func_coalesce(Item *a, Item *b) - :Item_func(a, b), cached_result_type(INT_RESULT) - {} + Item_func_coalesce(Item *a, Item *b) :Item_func_numhybrid(a, b) {} public: - Item_func_coalesce(List &list) - :Item_func(list),cached_result_type(INT_RESULT) - {} - double val_real(); - longlong val_int(); - String *val_str(String *); - my_decimal *val_decimal(my_decimal *); + Item_func_coalesce(List &list) :Item_func_numhybrid(list) {} + double real_op(); + longlong int_op(); + String *str_op(String *); + my_decimal *decimal_op(my_decimal *); void fix_length_and_dec(); - enum Item_result result_type () const { return cached_result_type; } + void find_num_type() {} + enum Item_result result_type () const { return hybrid_type; } const char *func_name() const { return "coalesce"; } table_map not_null_tables() const { return 0; } }; @@ -482,10 +478,10 @@ protected: bool field_type_defined; public: Item_func_ifnull(Item *a, Item *b) :Item_func_coalesce(a,b) {} - double val_real(); - longlong val_int(); - String *val_str(String *str); - my_decimal *val_decimal(my_decimal *); + double real_op(); + longlong int_op(); + String *str_op(String *str); + my_decimal *decimal_op(my_decimal *); enum_field_types field_type() const; void fix_length_and_dec(); const char *func_name() const { return "ifnull"; } -- cgit v1.2.1