@@ -530,15 +530,19 @@ class Field_longstr :public Field_str
530
530
/* base class for float and double and decimal (old one) */
531
531
class Field_real :public Field_num {
532
532
public:
533
+ my_bool not_fixed;
534
+
533
535
Field_real (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
534
536
uchar null_bit_arg, utype unireg_check_arg,
535
537
const char *field_name_arg,
536
538
uint8 dec_arg, bool zero_arg, bool unsigned_arg)
537
539
: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)
539
542
{}
540
543
int store_decimal (const my_decimal *);
541
544
my_decimal *val_decimal (my_decimal *);
545
+ int truncate (double *nr, double max_length);
542
546
uint32 max_display_length () { return field_length; }
543
547
};
544
548
@@ -823,28 +827,24 @@ class Field_float :public Field_real {
823
827
824
828
class Field_double :public Field_real {
825
829
public:
826
- my_bool not_fixed;
827
830
Field_double (char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
828
831
uchar null_bit_arg,
829
832
enum utype unireg_check_arg, const char *field_name_arg,
830
833
uint8 dec_arg,bool zero_arg,bool unsigned_arg)
831
834
:Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
832
835
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)
835
837
{}
836
838
Field_double (uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
837
839
uint8 dec_arg)
838
840
: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 )
841
842
{}
842
843
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 )
844
845
: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; }
848
848
enum_field_types type () const { return MYSQL_TYPE_DOUBLE;}
849
849
enum ha_base_keytype key_type () const { return HA_KEYTYPE_DOUBLE; }
850
850
int store (const char *to,uint length,CHARSET_INFO *charset);
0 commit comments