~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.h

Fix for 64bit issue around timestamp

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                  const char *field_name_arg,
49
49
                  const CHARSET_INFO * const cs);
50
50
  enum_field_types type() const { return DRIZZLE_TYPE_TIMESTAMP;}
51
 
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
 
51
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
52
52
  enum Item_result cmp_type () const { return INT_RESULT; }
53
53
  int  store(const char *to,uint32_t length,
54
54
             const CHARSET_INFO * const charset);
55
55
  int  store(double nr);
56
56
  int  store(int64_t nr, bool unsigned_val);
57
 
  int  reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
 
57
  int  reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; }
58
58
  double val_real(void);
59
59
  int64_t val_int(void);
60
60
  String *val_str(String*,String *);
61
61
  int cmp(const unsigned char *,const unsigned char *);
62
62
  void sort_string(unsigned char *buff,uint32_t length);
63
 
  uint32_t pack_length() const { return 4; }
 
63
  uint32_t pack_length() const { return 8; }
64
64
  void sql_type(String &str) const;
65
65
  bool can_be_compared_as_int64_t() const { return true; }
66
66
  bool zero_pack() const { return 0; }
69
69
 
70
70
  /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
71
71
  long get_timestamp(bool *null_value);
72
 
  void store_timestamp(time_t timestamp);
 
72
private:
 
73
  void store_timestamp(int64_t timestamp);
73
74
  bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
74
75
  bool get_time(DRIZZLE_TIME *ltime);
 
76
public:
75
77
  timestamp_auto_set_type get_auto_set_type() const;
76
78
};
77
79