From 8125db1d9ae489162f08560f42c60c10a316afbc Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 17 Apr 2015 12:36:31 +0400 Subject: [PATCH] Moving fix_length_and_dec() from Item_result_field to Item_func_or_sum, as the other decendants of Item_result_field (Item_avg_field, Item_variance_field, Item_cache_wrapper) don't need fix_length_and_dec(). --- sql/item.h | 3 +-- sql/item_func.cc | 2 +- sql/item_sum.h | 2 -- sql/sql_udf.h | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/item.h b/sql/item.h index ede69f08373..762f2082188 100644 --- a/sql/item.h +++ b/sql/item.h @@ -3254,7 +3254,6 @@ public: Field *get_tmp_table_field() { return result_field; } Field *tmp_table_field(TABLE *t_arg) { return result_field; } table_map used_tables() const { return 1; } - virtual void fix_length_and_dec()=0; void set_result_field(Field *field) { result_field= field; } bool is_result_field() { return 1; } void save_in_result_field(bool no_conversions) @@ -3367,6 +3366,7 @@ public: also to make printing of items inherited from Item_sum uniform. */ virtual const char *func_name() const= 0; + virtual void fix_length_and_dec()= 0; }; @@ -3652,7 +3652,6 @@ public: bool set_cache(THD *thd); bool fix_fields(THD *thd, Item **it); - void fix_length_and_dec() {} void cleanup(); /* Methods of getting value which should be cached in the cache */ diff --git a/sql/item_func.cc b/sql/item_func.cc index 9179a20ecae..50bc85f2c73 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3482,7 +3482,7 @@ void udf_handler::cleanup() bool -udf_handler::fix_fields(THD *thd, Item_result_field *func, +udf_handler::fix_fields(THD *thd, Item_func_or_sum *func, uint arg_count, Item **arguments) { uchar buff[STACK_BUFF_ALLOC]; // Max argument in function diff --git a/sql/item_sum.h b/sql/item_sum.h index 15556051972..8435924e62d 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -829,7 +829,6 @@ public: return hybrid_type == DECIMAL_RESULT ? MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE; } - void fix_length_and_dec() {} enum Item_result result_type () const { return hybrid_type; } bool check_vcol_func_processor(uchar *int_arg) { @@ -909,7 +908,6 @@ public: return hybrid_type == DECIMAL_RESULT ? MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE; } - void fix_length_and_dec() {} enum Item_result result_type () const { return hybrid_type; } bool check_vcol_func_processor(uchar *int_arg) { diff --git a/sql/sql_udf.h b/sql/sql_udf.h index 4aa055b9858..076c5440aef 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -76,7 +76,7 @@ class udf_handler :public Sql_alloc Item_result result_type () const { return u_d ? u_d->returns : STRING_RESULT;} bool get_arguments(); - bool fix_fields(THD *thd, Item_result_field *item, + bool fix_fields(THD *thd, Item_func_or_sum *item, uint arg_count, Item **args); void cleanup(); double val(my_bool *null_value)