~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/date.h

  • Committer: Monty Taylor
  • Date: 2009-05-09 22:13:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090509221347-l712szviusbobro0
Re-added bitset<> as a replacement for Bitmap<>

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#ifndef DRIZZLE_SERVER_FIELD_NEW_DATE
22
 
#define DRIZZLE_SERVER_FIELD_NEW_DATE
23
 
 
24
 
class Field_newdate :public Field_str {
 
21
#ifndef DRIZZLE_SERVER_FIELD_DATE
 
22
#define DRIZZLE_SERVER_FIELD_DATE
 
23
 
 
24
#include <drizzled/field/str.h>
 
25
 
 
26
class Field_date :public Field_str {
25
27
public:
26
 
  Field_newdate(unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg,
27
 
                enum utype unireg_check_arg, const char *field_name_arg,
28
 
                const CHARSET_INFO * const cs)
 
28
 
 
29
  using Field::store;
 
30
  using Field::val_int;
 
31
  using Field::val_str;
 
32
  using Field::cmp;
 
33
 
 
34
  Field_date(unsigned char *ptr_arg, unsigned char *null_ptr_arg,
 
35
             unsigned char null_bit_arg,
 
36
             enum utype unireg_check_arg, const char *field_name_arg,
 
37
             const CHARSET_INFO * const cs)
29
38
    :Field_str(ptr_arg, 10, null_ptr_arg, null_bit_arg,
30
 
               unireg_check_arg, field_name_arg, cs)
 
39
               unireg_check_arg, field_name_arg, cs)
31
40
    {}
32
 
  Field_newdate(bool maybe_null_arg, const char *field_name_arg,
 
41
  Field_date(bool maybe_null_arg, const char *field_name_arg,
33
42
                const CHARSET_INFO * const cs)
34
43
    :Field_str((unsigned char*) 0,10, maybe_null_arg ? (unsigned char*) "": 0,0,
35
44
               NONE, field_name_arg, cs) {}
36
 
  enum_field_types type() const { return DRIZZLE_TYPE_NEWDATE;}
37
 
  enum_field_types real_type() const { return DRIZZLE_TYPE_NEWDATE; }
 
45
  enum_field_types type() const { return DRIZZLE_TYPE_DATE;}
 
46
  enum_field_types real_type() const { return DRIZZLE_TYPE_DATE; }
38
47
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_UINT24; }
39
48
  enum Item_result cmp_type () const { return INT_RESULT; }
40
 
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
 
49
  int  store(const char *to,uint32_t length,
 
50
             const CHARSET_INFO * const charset);
41
51
  int  store(double nr);
42
52
  int  store(int64_t nr, bool unsigned_val);
43
53
  int store_time(DRIZZLE_TIME *ltime, enum enum_drizzle_timestamp_type type);
45
55
  double val_real(void);
46
56
  int64_t val_int(void);
47
57
  String *val_str(String*,String *);
48
 
  bool send_binary(Protocol *protocol);
49
58
  int cmp(const unsigned char *,const unsigned char *);
50
59
  void sort_string(unsigned char *buff,uint32_t length);
51
60
  uint32_t pack_length() const { return 3; }