18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_FIELD_TIMESTAMP_H
22
#define DRIZZLED_FIELD_TIMESTAMP_H
21
#ifndef DRIZZLED_FIELD_EPOCH_H
22
#define DRIZZLED_FIELD_EPOCH_H
24
24
#include <drizzled/field/str.h>
30
33
typedef struct charset_info_st CHARSET_INFO;
32
class Field_timestamp :public Field_str {
35
class Epoch :public Field_str {
38
typedef Epoch* pointer;
35
40
using Field::val_int;
36
41
using Field::val_str;
38
43
using Field::store;
39
Field_timestamp(unsigned char *ptr_arg,
41
unsigned char *null_ptr_arg,
42
unsigned char null_bit_arg,
43
enum utype unireg_check_arg,
44
const char *field_name_arg,
46
const CHARSET_INFO * const cs);
47
Field_timestamp(bool maybe_null_arg,
48
const char *field_name_arg,
49
const CHARSET_INFO * const cs);
45
Epoch(unsigned char *ptr_arg,
47
unsigned char *null_ptr_arg,
48
unsigned char null_bit_arg,
49
enum utype unireg_check_arg,
50
const char *field_name_arg,
51
drizzled::TableShare *share,
52
const drizzled::CHARSET_INFO * const cs);
54
Epoch(bool maybe_null_arg,
55
const char *field_name_arg,
56
const CHARSET_INFO * const cs);
50
58
enum_field_types type() const { return DRIZZLE_TYPE_TIMESTAMP;}
51
59
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
52
60
enum Item_result cmp_type () const { return INT_RESULT; }
70
78
/* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
71
79
long get_timestamp(bool *null_value);
73
void store_timestamp(int64_t timestamp);
74
82
bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
75
83
bool get_time(DRIZZLE_TIME *ltime);
77
86
timestamp_auto_set_type get_auto_set_type() const;
87
static size_t max_string_length();
90
} /* namespace field */
80
91
} /* namespace drizzled */
82
#endif /* DRIZZLED_FIELD_TIMESTAMP_H */
93
#endif /* DRIZZLED_FIELD_EPOCH_H */