Commit 8125db1d authored by Alexander Barkov's avatar Alexander Barkov

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().
parent 99898c6f
...@@ -3254,7 +3254,6 @@ public: ...@@ -3254,7 +3254,6 @@ public:
Field *get_tmp_table_field() { return result_field; } Field *get_tmp_table_field() { return result_field; }
Field *tmp_table_field(TABLE *t_arg) { return result_field; } Field *tmp_table_field(TABLE *t_arg) { return result_field; }
table_map used_tables() const { return 1; } table_map used_tables() const { return 1; }
virtual void fix_length_and_dec()=0;
void set_result_field(Field *field) { result_field= field; } void set_result_field(Field *field) { result_field= field; }
bool is_result_field() { return 1; } bool is_result_field() { return 1; }
void save_in_result_field(bool no_conversions) void save_in_result_field(bool no_conversions)
...@@ -3367,6 +3366,7 @@ public: ...@@ -3367,6 +3366,7 @@ public:
also to make printing of items inherited from Item_sum uniform. also to make printing of items inherited from Item_sum uniform.
*/ */
virtual const char *func_name() const= 0; virtual const char *func_name() const= 0;
virtual void fix_length_and_dec()= 0;
}; };
...@@ -3652,7 +3652,6 @@ public: ...@@ -3652,7 +3652,6 @@ public:
bool set_cache(THD *thd); bool set_cache(THD *thd);
bool fix_fields(THD *thd, Item **it); bool fix_fields(THD *thd, Item **it);
void fix_length_and_dec() {}
void cleanup(); void cleanup();
/* Methods of getting value which should be cached in the cache */ /* Methods of getting value which should be cached in the cache */
......
...@@ -3482,7 +3482,7 @@ void udf_handler::cleanup() ...@@ -3482,7 +3482,7 @@ void udf_handler::cleanup()
bool 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) uint arg_count, Item **arguments)
{ {
uchar buff[STACK_BUFF_ALLOC]; // Max argument in function uchar buff[STACK_BUFF_ALLOC]; // Max argument in function
......
...@@ -829,7 +829,6 @@ public: ...@@ -829,7 +829,6 @@ public:
return hybrid_type == DECIMAL_RESULT ? return hybrid_type == DECIMAL_RESULT ?
MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE; MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE;
} }
void fix_length_and_dec() {}
enum Item_result result_type () const { return hybrid_type; } enum Item_result result_type () const { return hybrid_type; }
bool check_vcol_func_processor(uchar *int_arg) bool check_vcol_func_processor(uchar *int_arg)
{ {
...@@ -909,7 +908,6 @@ public: ...@@ -909,7 +908,6 @@ public:
return hybrid_type == DECIMAL_RESULT ? return hybrid_type == DECIMAL_RESULT ?
MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE; MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE;
} }
void fix_length_and_dec() {}
enum Item_result result_type () const { return hybrid_type; } enum Item_result result_type () const { return hybrid_type; }
bool check_vcol_func_processor(uchar *int_arg) bool check_vcol_func_processor(uchar *int_arg)
{ {
......
...@@ -76,7 +76,7 @@ class udf_handler :public Sql_alloc ...@@ -76,7 +76,7 @@ class udf_handler :public Sql_alloc
Item_result result_type () const Item_result result_type () const
{ return u_d ? u_d->returns : STRING_RESULT;} { return u_d ? u_d->returns : STRING_RESULT;}
bool get_arguments(); 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); uint arg_count, Item **args);
void cleanup(); void cleanup();
double val(my_bool *null_value) double val(my_bool *null_value)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment