@@ -826,11 +826,11 @@ class Item_sum_avg;
826826
827827class Item_avg_field :public Item_result_field
828828{
829- public:
830829 Field *field;
831830 Item_result hybrid_type;
832831 uint f_precision, f_scale, dec_bin_size;
833832 uint prec_increment;
833+ public:
834834 Item_avg_field (THD *thd, Item_result res_type, Item_sum_avg *item);
835835 enum Type type () const { return FIELD_AVG_ITEM; }
836836 double val_real ();
@@ -898,14 +898,9 @@ class Item_sum_variance;
898898
899899class Item_variance_field :public Item_result_field
900900{
901- public:
902901 Field *field;
903- Item_result hybrid_type;
904- uint f_precision0, f_scale0;
905- uint f_precision1, f_scale1;
906- uint dec_bin_size0, dec_bin_size1;
907902 uint sample;
908- uint prec_increment;
903+ public:
909904 Item_variance_field (THD *thd, Item_sum_variance *item);
910905 enum Type type () const {return FIELD_VARIANCE_ITEM; }
911906 double val_real ();
@@ -916,12 +911,8 @@ class Item_variance_field :public Item_result_field
916911 my_decimal *val_decimal (my_decimal *dec_buf)
917912 { return val_decimal_from_real (dec_buf); }
918913 bool is_null () { update_null_value (); return null_value; }
919- enum_field_types field_type () const
920- {
921- return hybrid_type == DECIMAL_RESULT ?
922- MYSQL_TYPE_NEWDECIMAL : MYSQL_TYPE_DOUBLE;
923- }
924- enum Item_result result_type () const { return hybrid_type; }
914+ enum_field_types field_type () const { return MYSQL_TYPE_DOUBLE; }
915+ enum Item_result result_type () const { return REAL_RESULT; }
925916 bool check_vcol_func_processor (uchar *int_arg)
926917 {
927918 return trace_unsupported_by_check_vcol_func_processor (" var_field" );
@@ -954,18 +945,13 @@ class Item_sum_variance : public Item_sum_num
954945 void fix_length_and_dec ();
955946
956947public:
957- Item_result hybrid_type;
958- int cur_dec;
959948 double recurrence_m, recurrence_s; /* Used in recurrence relation. */
960949 ulonglong count;
961- uint f_precision0, f_scale0;
962- uint f_precision1, f_scale1;
963- uint dec_bin_size0, dec_bin_size1;
964950 uint sample;
965951 uint prec_increment;
966952
967953 Item_sum_variance (THD *thd, Item *item_par, uint sample_arg):
968- Item_sum_num (thd, item_par), hybrid_type(REAL_RESULT), count(0 ),
954+ Item_sum_num (thd, item_par), count(0 ),
969955 sample (sample_arg)
970956 {}
971957 Item_sum_variance (THD *thd, Item_sum_variance *item);
@@ -983,6 +969,7 @@ class Item_sum_variance : public Item_sum_num
983969 Item *copy_or_same (THD* thd);
984970 Field *create_tmp_field (bool group, TABLE *table, uint convert_blob_length);
985971 enum Item_result result_type () const { return REAL_RESULT; }
972+ enum_field_types field_type () const { return MYSQL_TYPE_DOUBLE;}
986973 void cleanup ()
987974 {
988975 count= 0 ;
@@ -998,9 +985,6 @@ class Item_std_field :public Item_variance_field
998985 Item_std_field (THD *thd, Item_sum_std *item);
999986 enum Type type () const { return FIELD_STD_ITEM; }
1000987 double val_real ();
1001- my_decimal *val_decimal (my_decimal *);
1002- enum Item_result result_type () const { return REAL_RESULT; }
1003- enum_field_types field_type () const { return MYSQL_TYPE_DOUBLE;}
1004988};
1005989
1006990/*
@@ -1020,8 +1004,6 @@ class Item_sum_std :public Item_sum_variance
10201004 Item *result_item (THD *thd, Field *field);
10211005 const char *func_name () const { return " std(" ; }
10221006 Item *copy_or_same (THD* thd);
1023- enum Item_result result_type () const { return REAL_RESULT; }
1024- enum_field_types field_type () const { return MYSQL_TYPE_DOUBLE;}
10251007};
10261008
10271009// This class is a string or number function depending on num_func
0 commit comments