@@ -530,15 +530,19 @@ class Field_longstr :public Field_str
530530/* base class for float and double and decimal (old one) */
531531class Field_real :public Field_num {
532532public:
533+ my_bool not_fixed;
534+
533535 Field_real (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
534536 uchar null_bit_arg, utype unireg_check_arg,
535537 const char *field_name_arg,
536538 uint8 dec_arg, bool zero_arg, bool unsigned_arg)
537539 :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
538- field_name_arg, dec_arg, zero_arg, unsigned_arg)
540+ field_name_arg, dec_arg, zero_arg, unsigned_arg),
541+ not_fixed (dec_arg >= NOT_FIXED_DEC)
539542 {}
540543 int store_decimal (const my_decimal *);
541544 my_decimal *val_decimal (my_decimal *);
545+ int truncate (double *nr, double max_length);
542546 uint32 max_display_length () { return field_length; }
543547};
544548
@@ -823,28 +827,24 @@ class Field_float :public Field_real {
823827
824828class Field_double :public Field_real {
825829public:
826- my_bool not_fixed;
827830 Field_double (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
828831 uchar null_bit_arg,
829832 enum utype unireg_check_arg, const char *field_name_arg,
830833 uint8 dec_arg,bool zero_arg,bool unsigned_arg)
831834 :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
832835 unireg_check_arg, field_name_arg,
833- dec_arg, zero_arg, unsigned_arg),
834- not_fixed (dec_arg >= NOT_FIXED_DEC)
836+ dec_arg, zero_arg, unsigned_arg)
835837 {}
836838 Field_double (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
837839 uint8 dec_arg)
838840 :Field_real((char *) 0 , len_arg, maybe_null_arg ? (uchar*) " " : 0 , (uint) 0 ,
839- NONE, field_name_arg, dec_arg, 0, 0),
840- not_fixed(dec_arg >= NOT_FIXED_DEC)
841+ NONE, field_name_arg, dec_arg, 0 , 0 )
841842 {}
842843 Field_double (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
843- uint8 dec_arg, my_bool not_fixed_srg )
844+ uint8 dec_arg, my_bool not_fixed_arg )
844845 :Field_real((char *) 0 , len_arg, maybe_null_arg ? (uchar*) " " : 0 , (uint) 0 ,
845- NONE, field_name_arg, dec_arg, 0, 0),
846- not_fixed(not_fixed_srg)
847- {}
846+ NONE, field_name_arg, dec_arg, 0 , 0 )
847+ {not_fixed= not_fixed_arg; }
848848 enum_field_types type () const { return MYSQL_TYPE_DOUBLE;}
849849 enum ha_base_keytype key_type () const { return HA_KEYTYPE_DOUBLE; }
850850 int store (const char *to,uint length,CHARSET_INFO *charset);
0 commit comments