~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/timestamp.h

pandora-build v0.71. Added check for avahi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <drizzled/field/str.h>
25
25
 
26
 
namespace drizzled
27
 
{
28
 
 
29
26
class TableShare;
30
27
typedef struct charset_info_st CHARSET_INFO;
31
28
 
48
45
                  const char *field_name_arg,
49
46
                  const CHARSET_INFO * const cs);
50
47
  enum_field_types type() const { return DRIZZLE_TYPE_TIMESTAMP;}
51
 
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
 
48
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
52
49
  enum Item_result cmp_type () const { return INT_RESULT; }
53
50
  int  store(const char *to,uint32_t length,
54
51
             const CHARSET_INFO * const charset);
55
52
  int  store(double nr);
56
53
  int  store(int64_t nr, bool unsigned_val);
57
 
  int  reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=ptr[4]=ptr[5]=ptr[6]=ptr[7]=0; return 0; }
 
54
  int  reset(void) { ptr[0]=ptr[1]=ptr[2]=ptr[3]=0; return 0; }
58
55
  double val_real(void);
59
56
  int64_t val_int(void);
60
57
  String *val_str(String*,String *);
61
58
  int cmp(const unsigned char *,const unsigned char *);
62
59
  void sort_string(unsigned char *buff,uint32_t length);
63
 
  uint32_t pack_length() const { return 8; }
 
60
  uint32_t pack_length() const { return 4; }
64
61
  void sql_type(String &str) const;
65
62
  bool can_be_compared_as_int64_t() const { return true; }
66
63
  bool zero_pack() const { return 0; }
69
66
 
70
67
  /* Get TIMESTAMP field value as seconds since begging of Unix Epoch */
71
68
  long get_timestamp(bool *null_value);
72
 
private:
73
 
  void store_timestamp(int64_t timestamp);
 
69
  void store_timestamp(time_t timestamp);
74
70
  bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
75
71
  bool get_time(DRIZZLE_TIME *ltime);
76
 
public:
77
72
  timestamp_auto_set_type get_auto_set_type() const;
78
73
};
79
74
 
80
 
} /* namespace drizzled */
81
 
 
82
75
#endif /* DRIZZLED_FIELD_TIMESTAMP_H */
83
76