~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/field.h

  • Committer: Toru Maesaka
  • Date: 2008-07-18 09:08:53 UTC
  • mto: (202.1.1 toru)
  • mto: This revision was merged to the branch mainline in revision 204.
  • Revision ID: dev@torum.net-20080718090853-xep3mudb1cif9gg6
ripped out DOUBLE and moved to field/

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#endif
25
25
 
26
26
#define DATETIME_DEC                     6
 
27
#define DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE FLOATING_POINT_BUFFER
 
28
 
27
29
const uint32 max_field_size= (uint32) 4294967295U;
28
30
 
29
31
class Send_field;
918
920
  }
919
921
};
920
922
 
921
 
class Field_double :public Field_real {
922
 
public:
923
 
  Field_double(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
924
 
               uchar null_bit_arg,
925
 
               enum utype unireg_check_arg, const char *field_name_arg,
926
 
               uint8 dec_arg,bool zero_arg,bool unsigned_arg)
927
 
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
928
 
                unireg_check_arg, field_name_arg,
929
 
                dec_arg, zero_arg, unsigned_arg)
930
 
    {}
931
 
  Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
932
 
               uint8 dec_arg)
933
 
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
934
 
                NONE, field_name_arg, dec_arg, 0, 0)
935
 
    {}
936
 
  Field_double(uint32 len_arg, bool maybe_null_arg, const char *field_name_arg,
937
 
               uint8 dec_arg, my_bool not_fixed_arg)
938
 
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
939
 
                NONE, field_name_arg, dec_arg, 0, 0)
940
 
    {not_fixed= not_fixed_arg; }
941
 
  enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
942
 
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
943
 
  int  store(const char *to,uint length,CHARSET_INFO *charset);
944
 
  int  store(double nr);
945
 
  int  store(int64_t nr, bool unsigned_val);
946
 
  int reset(void) { bzero(ptr,sizeof(double)); return 0; }
947
 
  double val_real(void);
948
 
  int64_t val_int(void);
949
 
  String *val_str(String*,String *);
950
 
  bool send_binary(Protocol *protocol);
951
 
  int cmp(const uchar *,const uchar *);
952
 
  void sort_string(uchar *buff,uint length);
953
 
  uint32 pack_length() const { return sizeof(double); }
954
 
  uint row_pack_length() { return pack_length(); }
955
 
  void sql_type(String &str) const;
956
 
private:
957
 
  int do_save_field_metadata(uchar *first_byte);
958
 
};
959
 
 
960
923
 
961
924
class Field_enum :public Field_str {
962
925
protected:
1168
1131
#include "field/year.h"
1169
1132
#include "field/date.h"
1170
1133
#include "field/decimal.h"
 
1134
#include "field/double.h"
1171
1135
#include "field/timetype.h"
1172
1136
#include "field/timestamp.h"
1173
1137
#include "field/datetime.h"