21
21
#ifndef DRIZZLE_SERVER_FIELD_TIMESTAMP
22
22
#define DRIZZLE_SERVER_FIELD_TIMESTAMP
24
#include "mysql_priv.h"
24
26
class Field_timestamp :public Field_str {
26
Field_timestamp(unsigned char *ptr_arg, uint32_t len_arg,
27
unsigned char *null_ptr_arg, unsigned char null_bit_arg,
28
Field_timestamp(uchar *ptr_arg, uint32_t len_arg,
29
uchar *null_ptr_arg, uchar null_bit_arg,
28
30
enum utype unireg_check_arg, const char *field_name_arg,
29
TABLE_SHARE *share, const CHARSET_INFO * const cs);
31
TABLE_SHARE *share, CHARSET_INFO *cs);
30
32
Field_timestamp(bool maybe_null_arg, const char *field_name_arg,
31
const CHARSET_INFO * const cs);
32
34
enum_field_types type() const { return DRIZZLE_TYPE_TIMESTAMP;}
33
35
enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
34
36
enum Item_result cmp_type () const { return INT_RESULT; }
35
int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
37
int store(const char *to,uint length,CHARSET_INFO *charset);
36
38
int store(double nr);
37
39
int store(int64_t nr, bool unsigned_val);
38
40
int reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
40
42
int64_t val_int(void);
41
43
String *val_str(String*,String *);
42
44
bool send_binary(Protocol *protocol);
43
int cmp(const unsigned char *,const unsigned char *);
44
void sort_string(unsigned char *buff,uint32_t length);
45
int cmp(const uchar *,const uchar *);
46
void sort_string(uchar *buff,uint length);
45
47
uint32_t pack_length() const { return 4; }
46
48
void sql_type(String &str) const;
47
49
bool can_be_compared_as_int64_t() const { return true; }
80
82
longstore(ptr,(uint32_t) timestamp);
82
bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
83
bool get_time(DRIZZLE_TIME *ltime);
84
bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
85
bool get_time(MYSQL_TIME *ltime);
84
86
timestamp_auto_set_type get_auto_set_type() const;