diff options
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sql/field.h b/sql/field.h index 78aa12ad200..00854ca11b5 100644 --- a/sql/field.h +++ b/sql/field.h @@ -453,6 +453,7 @@ public: /* base class for float and double and decimal (old one) */ class Field_real :public Field_num { public: + my_bool not_fixed; Field_real(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, utype unireg_check_arg, @@ -460,12 +461,14 @@ public: struct st_table *table_arg, uint8 dec_arg, bool zero_arg, bool unsigned_arg) :Field_num(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, - field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg) + field_name_arg, table_arg, dec_arg, zero_arg, unsigned_arg), + not_fixed(dec_arg >= NOT_FIXED_DEC) {} int store_decimal(const my_decimal *); my_decimal *val_decimal(my_decimal *); + int truncate(double *nr, double max_length); uint32 max_display_length() { return field_length; } }; @@ -758,7 +761,6 @@ public: class Field_double :public Field_real { public: - my_bool not_fixed; Field_double(char *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, @@ -766,21 +768,18 @@ public: uint8 dec_arg,bool zero_arg,bool unsigned_arg) :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg, table_arg, - dec_arg, zero_arg, unsigned_arg), - not_fixed(dec_arg >= NOT_FIXED_DEC) + dec_arg, zero_arg, unsigned_arg) {} Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, struct st_table *table_arg, uint8 dec_arg) :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, - NONE, field_name_arg, table_arg, dec_arg, 0, 0), - not_fixed(dec_arg >= NOT_FIXED_DEC) + NONE, field_name_arg, table_arg, dec_arg, 0, 0) {} Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg, - struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_srg) + struct st_table *table_arg, uint8 dec_arg, my_bool not_fixed_arg) :Field_real((char*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0, - NONE, field_name_arg, table_arg, dec_arg, 0, 0), - not_fixed(not_fixed_srg) - {} + NONE, field_name_arg, table_arg, dec_arg, 0, 0) + {not_fixed= not_fixed_arg; } enum_field_types type() const { return FIELD_TYPE_DOUBLE;} enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; } int store(const char *to,uint length,CHARSET_INFO *charset); |