~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
 
#pragma once
 
21
#ifndef DRIZZLED_FIELD_DATETIME_H
 
22
#define DRIZZLED_FIELD_DATETIME_H
22
23
 
23
24
#include <drizzled/field/str.h>
24
25
 
36
37
  Field_datetime(unsigned char *ptr_arg,
37
38
                 unsigned char *null_ptr_arg,
38
39
                 unsigned char null_bit_arg,
39
 
                 const char *field_name_arg) :
40
 
    Field_str(ptr_arg,
 
40
                 const char *field_name_arg,
 
41
                 const CHARSET_INFO * const cs)
 
42
    :Field_str(ptr_arg,
41
43
               19,
42
44
               null_ptr_arg,
43
45
               null_bit_arg,
44
46
               field_name_arg,
45
 
               &my_charset_bin)
 
47
               cs)
46
48
  {}
47
 
 
48
49
  Field_datetime(bool maybe_null_arg,
49
 
                 const char *field_name_arg) :
50
 
    Field_str((unsigned char*) 0,
 
50
                 const char *field_name_arg,
 
51
                 const CHARSET_INFO * const cs)
 
52
    :Field_str((unsigned char*) 0,
51
53
               19,
52
54
               maybe_null_arg ? (unsigned char*) "": 0,
53
55
               0,
54
56
               field_name_arg,
55
 
               &my_charset_bin) 
 
57
               cs) 
56
58
  {}
57
 
 
58
59
  enum_field_types type() const { return DRIZZLE_TYPE_DATETIME;}
59
60
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
60
61
  enum Item_result cmp_type () const { return INT_RESULT; }
61
62
  uint32_t decimals() const { return DATETIME_DEC; }
62
 
  int  store(const char *to,uint32_t length, const charset_info_st * const charset);
 
63
  int  store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
63
64
  int  store(double nr);
64
65
  int  store(int64_t nr, bool unsigned_val);
65
66
  int store_time(type::Time &ltime, type::timestamp_t type);
68
69
    ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0;
69
70
    return 0;
70
71
  }
71
 
  double val_real(void) const;
72
 
  int64_t val_int(void) const;
73
 
  String *val_str(String*,String *) const;
 
72
  double val_real(void);
 
73
  int64_t val_int(void);
 
74
  String *val_str(String*,String *);
74
75
  int cmp(const unsigned char *,const unsigned char *);
75
76
  void sort_string(unsigned char *buff,uint32_t length);
76
77
  uint32_t pack_length() const { return 8; }
77
78
  void sql_type(String &str) const;
78
79
  bool can_be_compared_as_int64_t() const { return true; }
79
80
  bool zero_pack() const { return 1; }
80
 
  bool get_date(type::Time &ltime,uint32_t fuzzydate) const;
81
 
  bool get_time(type::Time &ltime) const;
 
81
  bool get_date(type::Time &ltime,uint32_t fuzzydate);
 
82
  bool get_time(type::Time &ltime);
82
83
};
83
84
 
84
85
} /* namespace drizzled */
85
86
 
 
87
#endif /* DRIZZLED_FIELD_DATETIME_H */