~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/field/double.h

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* - mode: c++ c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 MySQL
21
21
#ifndef DRIZZLE_SERVER_FIELD_DOUBLE
22
22
#define DRIZZLE_SERVER_FIELD_DOUBLE
23
23
 
 
24
#include "mysql_priv.h"
 
25
 
24
26
class Field_double :public Field_real {
25
27
public:
26
 
  Field_double(unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg,
27
 
               unsigned char null_bit_arg,
 
28
  Field_double(uchar *ptr_arg, uint32_t len_arg, uchar *null_ptr_arg,
 
29
               uchar null_bit_arg,
28
30
               enum utype unireg_check_arg, const char *field_name_arg,
29
31
               uint8_t dec_arg,bool zero_arg,bool unsigned_arg)
30
32
    :Field_real(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
33
35
    {}
34
36
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
35
37
               uint8_t dec_arg)
36
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint) 0,
 
38
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
37
39
                NONE, field_name_arg, dec_arg, 0, 0)
38
40
    {}
39
41
  Field_double(uint32_t len_arg, bool maybe_null_arg, const char *field_name_arg,
40
 
               uint8_t dec_arg, bool not_fixed_arg)
41
 
    :Field_real((unsigned char*) 0, len_arg, maybe_null_arg ? (unsigned char*) "" : 0, (uint) 0,
 
42
               uint8_t dec_arg, my_bool not_fixed_arg)
 
43
    :Field_real((uchar*) 0, len_arg, maybe_null_arg ? (uchar*) "" : 0, (uint) 0,
42
44
                NONE, field_name_arg, dec_arg, 0, 0)
43
45
    {not_fixed= not_fixed_arg; }
44
 
  enum_field_types type() const { return DRIZZLE_TYPE_DOUBLE;}
 
46
  enum_field_types type() const { return MYSQL_TYPE_DOUBLE;}
45
47
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_DOUBLE; }
46
 
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
 
48
  int  store(const char *to,uint length,CHARSET_INFO *charset);
47
49
  int  store(double nr);
48
50
  int  store(int64_t nr, bool unsigned_val);
49
 
  int reset(void) { memset(ptr, 0, sizeof(double)); return 0; }
 
51
  int reset(void) { bzero(ptr,sizeof(double)); return 0; }
50
52
  double val_real(void);
51
53
  int64_t val_int(void);
52
54
  String *val_str(String*,String *);
53
55
  bool send_binary(Protocol *protocol);
54
 
  int cmp(const unsigned char *,const unsigned char *);
55
 
  void sort_string(unsigned char *buff,uint32_t length);
 
56
  int cmp(const uchar *,const uchar *);
 
57
  void sort_string(uchar *buff,uint length);
56
58
  uint32_t pack_length() const { return sizeof(double); }
57
 
  uint32_t row_pack_length() { return pack_length(); }
 
59
  uint row_pack_length() { return pack_length(); }
58
60
  void sql_type(String &str) const;
59
61
private:
60
 
  int do_save_field_metadata(unsigned char *first_byte);
 
62
  int do_save_field_metadata(uchar *first_byte);
61
63
};
62
64
 
63
65
#endif