@@ -1027,26 +1027,26 @@ class Item_sum_std :public Item_sum_variance
1027
1027
// This class is a string or number function depending on num_func
1028
1028
class Arg_comparator ;
1029
1029
class Item_cache ;
1030
- class Item_sum_hybrid :public Item_sum
1030
+ class Item_sum_hybrid :public Item_sum , public Type_handler_hybrid_field_type
1031
1031
{
1032
1032
protected:
1033
1033
Item_cache *value, *arg_cache;
1034
1034
Arg_comparator *cmp;
1035
- Item_result hybrid_type;
1036
- enum_field_types hybrid_field_type;
1037
1035
int cmp_sign;
1038
1036
bool was_values; // Set if we have found at least one row (for max/min only)
1039
1037
bool was_null_value;
1040
1038
1041
1039
public:
1042
1040
Item_sum_hybrid (THD *thd, Item *item_par,int sign):
1043
- Item_sum (thd, item_par), value(0 ), arg_cache(0 ), cmp(0 ),
1044
- hybrid_type (INT_RESULT), hybrid_field_type(MYSQL_TYPE_LONGLONG),
1041
+ Item_sum (thd, item_par),
1042
+ Type_handler_hybrid_field_type (MYSQL_TYPE_LONGLONG),
1043
+ value (0 ), arg_cache(0 ), cmp(0 ),
1045
1044
cmp_sign (sign), was_values(TRUE )
1046
1045
{ collation.set (&my_charset_bin); }
1047
1046
Item_sum_hybrid (THD *thd, Item_sum_hybrid *item)
1048
- :Item_sum(thd, item), value(item->value), arg_cache(0 ),
1049
- hybrid_type (item->hybrid_type), hybrid_field_type(item->hybrid_field_type),
1047
+ :Item_sum(thd, item),
1048
+ Type_handler_hybrid_field_type (item),
1049
+ value(item->value), arg_cache(0 ),
1050
1050
cmp_sign(item->cmp_sign), was_values(item->was_values)
1051
1051
{ }
1052
1052
bool fix_fields (THD *, Item **);
@@ -1058,8 +1058,12 @@ class Item_sum_hybrid :public Item_sum
1058
1058
void reset_field ();
1059
1059
String *val_str (String *);
1060
1060
bool keep_field_type (void ) const { return 1 ; }
1061
- enum Item_result result_type () const { return hybrid_type; }
1062
- enum enum_field_types field_type () const { return hybrid_field_type; }
1061
+ enum Item_result result_type () const
1062
+ { return Type_handler_hybrid_field_type::result_type (); }
1063
+ enum Item_result cmp_type () const
1064
+ { return Type_handler_hybrid_field_type::cmp_type (); }
1065
+ enum enum_field_types field_type () const
1066
+ { return Type_handler_hybrid_field_type::field_type (); }
1063
1067
void update_field ();
1064
1068
void min_max_update_str_field ();
1065
1069
void min_max_update_real_field ();
0 commit comments