@@ -453,19 +453,22 @@ class Field_longstr :public Field_str
453453/* base class for float and double and decimal (old one) */
454454class Field_real :public Field_num {
455455public:
456+ my_bool not_fixed;
456457
457458 Field_real (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
458459 uchar null_bit_arg, utype unireg_check_arg,
459460 const char *field_name_arg,
460461 struct st_table *table_arg,
461462 uint8 dec_arg, bool zero_arg, bool unsigned_arg)
462463 :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg,
463- field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg)
464+ field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg),
465+ not_fixed (dec_arg >= NOT_FIXED_DEC )
464466 {}
465467
466468
467469 int store_decimal (const my_decimal *);
468470 my_decimal *val_decimal (my_decimal *);
471+ int truncate (double *nr, double max_length);
469472 uint32 max_display_length () { return field_length; }
470473};
471474
@@ -758,29 +761,25 @@ class Field_float :public Field_real {
758761
759762class Field_double :public Field_real {
760763public:
761- my_bool not_fixed;
762764 Field_double (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
763765 uchar null_bit_arg,
764766 enum utype unireg_check_arg, const char *field_name_arg,
765767 struct st_table *table_arg,
766768 uint8 dec_arg,bool zero_arg,bool unsigned_arg)
767769 :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
768770 unireg_check_arg, field_name_arg, table_arg,
769- dec_arg, zero_arg, unsigned_arg),
770- not_fixed (dec_arg >= NOT_FIXED_DEC )
771+ dec_arg, zero_arg, unsigned_arg)
771772 {}
772773 Field_double (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
773774 struct st_table *table_arg, uint8 dec_arg)
774775 :Field_real((char *) 0 , len_arg, maybe_null_arg ? (uchar*) " " : 0 , (uint) 0 ,
775- NONE, field_name_arg, table_arg, dec_arg, 0, 0),
776- not_fixed(dec_arg >= NOT_FIXED_DEC )
776+ NONE , field_name_arg, table_arg, dec_arg, 0 , 0 )
777777 {}
778778 Field_double (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
779- struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_srg )
779+ struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_arg )
780780 :Field_real((char *) 0 , len_arg, maybe_null_arg ? (uchar*) " " : 0 , (uint) 0 ,
781- NONE, field_name_arg, table_arg, dec_arg, 0, 0),
782- not_fixed(not_fixed_srg)
783- {}
781+ NONE , field_name_arg, table_arg, dec_arg, 0 , 0 )
782+ {not_fixed= not_fixed_arg; }
784783 enum_field_types type () const { return FIELD_TYPE_DOUBLE ;}
785784 enum ha_base_keytype key_type () const { return HA_KEYTYPE_DOUBLE ; }
786785 int store (const char *to,uint length,CHARSET_INFO *charset);
0 commit comments