|
| | Epoch (unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, drizzled::TableShare *share) |
| | Epoch (bool maybe_null_arg, const char *field_name_arg) |
| enum_field_types | type () const |
| enum ha_base_keytype | key_type () const |
| enum Item_result | cmp_type () const |
| int | store (const char *to, uint32_t length, const charset_info_st *const charset) |
| int | store (double nr) |
| int | store (int64_t nr, bool unsigned_val) |
| int | store_decimal (const type::Decimal *value) |
| int | reset (void) |
| double | val_real (void) const |
| int64_t | val_int (void) const |
| String * | val_str (String *, String *) const |
| int | cmp (const unsigned char *, const unsigned char *) |
| void | sort_string (unsigned char *buff, uint32_t length) |
| uint32_t | pack_length () const |
| virtual bool | can_be_compared_as_int64_t () const |
| bool | zero_pack () const |
| virtual void | set_time () |
| virtual void | set_default () |
| virtual long | get_timestamp (bool *null_value) const |
| virtual bool | is_timestamp () const |
| virtual timestamp_auto_set_type | get_auto_set_type () const |
| | Field_str (unsigned char *ptr_arg, uint32_t len_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, const char *field_name_arg, const charset_info_st *const charset) |
| Item_result | result_type () const |
| uint32_t | decimals () const |
| int | store (double nr) |
| int | store_decimal (const type::Decimal *) |
| uint32_t | size_of () const |
| const charset_info_st * | charset (void) const |
| void | set_charset (const charset_info_st *const charset_arg) |
| enum Derivation | derivation (void) const |
| virtual void | set_derivation (enum Derivation derivation_arg) |
| bool | binary () const |
| uint32_t | max_display_length () |
| type::Decimal * | val_decimal (type::Decimal *) const |
| virtual bool | str_needs_quotes () |
| uint32_t | max_data_length () const |
| Table * | getTable () |
| Table * | getTable () const |
| void | setTable (Table *table_arg) |
| bool | isUnsigned () const |
| uint16_t | position () const |
| void | setPosition (uint32_t arg) |
| | Field (unsigned char *ptr_arg, uint32_t length_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg, utype unireg_check_arg, const char *field_name_arg) |
| | This is used as a table name when the table structure is not set up.
|
| bool | hasDefault () const |
| int | store_and_check (enum_check_fields check_level, const char *to, uint32_t length, const charset_info_st *const cs) |
| virtual int | store_time (type::Time <ime, type::timestamp_t t_type) |
| String * | val_str_internal (String *str) const |
| virtual Item_result | cast_to_int_type () const |
| virtual bool | eq (Field *field) |
| virtual bool | eq_def (Field *field) |
| virtual uint32_t | pack_length_in_rec () const |
| virtual uint32_t | data_length () |
| virtual uint32_t | used_length () |
| virtual uint32_t | sort_length () const |
| virtual void | reset_fields () |
| virtual uint32_t | key_length () const |
| virtual enum_field_types | real_type () const |
| virtual int | cmp_max (const unsigned char *a, const unsigned char *b, uint32_t max_len) |
| int | cmp_internal (const unsigned char *str) |
| virtual int | cmp_binary (const unsigned char *a, const unsigned char *b, uint32_t max_length=UINT32_MAX) |
| virtual int | cmp_offset (uint32_t row_offset) |
| virtual int | cmp_binary_offset (uint32_t row_offset) |
| virtual int | key_cmp (const unsigned char *a, const unsigned char *b) |
| virtual int | key_cmp (const unsigned char *str, uint32_t length) |
| bool | is_null (ptrdiff_t row_offset=0) const |
| bool | is_real_null (ptrdiff_t row_offset=0) const |
| bool | is_null_in_record (const unsigned char *record) const |
| bool | is_null_in_record_with_offset (ptrdiff_t offset) const |
| void | set_null (ptrdiff_t row_offset=0) |
| void | set_notnull (ptrdiff_t row_offset=0) |
| bool | maybe_null (void) const |
| bool | real_maybe_null (void) const |
| virtual void | make_field (SendField *) |
| virtual bool | optimize_range (uint32_t idx, uint32_t part) |
| virtual void | free () |
| virtual Field * | new_field (memory::Root *, Table *, bool keep_type) |
| virtual Field * | new_key_field (memory::Root *root, Table *new_table, unsigned char *new_ptr, unsigned char *new_null_ptr, uint32_t new_null_bit) |
| Field * | clone (memory::Root *, Table *) |
| void | move_field (unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg) |
| void | move_field (unsigned char *ptr_arg) |
| virtual void | move_field_offset (ptrdiff_t ptr_diff) |
| virtual void | get_image (unsigned char *buff, uint32_t length, const charset_info_st *const) |
| virtual void | get_image (std::basic_string< unsigned char > &buff, uint32_t length, const charset_info_st *const) |
| virtual void | set_image (const unsigned char *buff, uint32_t length, const charset_info_st *const) |
| virtual uint32_t | get_key_image (unsigned char *buff, uint32_t length) |
| virtual uint32_t | get_key_image (std::basic_string< unsigned char > &buff, uint32_t length) |
| virtual void | set_key_image (const unsigned char *buff, uint32_t length) |
| int64_t | val_int_offset (uint32_t row_offset) |
| int64_t | val_int_internal (const unsigned char *new_ptr) |
| String * | val_str_internal (String *str, const unsigned char *new_ptr) |
| virtual unsigned char * | pack (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| unsigned char * | pack (unsigned char *to, const unsigned char *from) |
| virtual const unsigned char * | unpack (unsigned char *to, const unsigned char *from, uint32_t param_data, bool low_byte_first) |
| const unsigned char * | unpack (unsigned char *to, const unsigned char *from) |
| virtual unsigned char * | pack_key (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| virtual const unsigned char * | unpack_key (unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first) |
| virtual uint32_t | max_packed_col_length (uint32_t max_length) |
| uint32_t | offset (const unsigned char *record) |
| void | copy_from_tmp (int offset) |
| uint32_t | fill_cache_field (CacheField *copy) |
| virtual const charset_info_st * | sort_charset (void) const |
| virtual bool | has_charset (void) const |
| bool | set_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, const char *str, uint32_t str_len, type::timestamp_t ts_type, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, drizzled::error_t code, int64_t nr, type::timestamp_t ts_type, int cuted_increment) |
| void | set_datetime_warning (DRIZZLE_ERROR::enum_warning_level, const drizzled::error_t code, double nr, type::timestamp_t ts_type) |
| bool | check_overflow (int op_result) |
| int | warn_if_overflow (int op_result) |
| void | init (Table *table_arg) |
| virtual uint32_t | is_equal (CreateField *new_field) |
| int64_t | convert_decimal2int64_t (const type::Decimal *val, bool unsigned_flag, int *err) |
| uint32_t | char_length () const |
| enum column_format_type | column_format () const |
| virtual void | hash (uint32_t *nr, uint32_t *nr2) const |
| bool | isReadSet () const |
| bool | isWriteSet () |
| void | setReadSet (bool arg=true) |
| void | setWriteSet (bool arg=true) |
Definition at line 28 of file epoch.h.
| drizzled::field::Epoch::Epoch |
( |
unsigned char * | ptr_arg, |
|
|
unsigned char * | null_ptr_arg, |
|
|
unsigned char | null_bit_arg, |
|
|
enum utype | unireg_check_arg, |
|
|
const char * | field_name_arg, |
|
|
drizzled::TableShare * | share ) |
TIMESTAMP type holds datetime values in range from 1970-01-01 00:00:01 UTC to 2038-01-01 00:00:00 UTC stored as number of seconds since Unix Epoch in UTC.
Up to one of timestamps columns in the table can be automatically set on row update and/or have NOW() as default value. TABLE::timestamp_field points to Field object for such timestamp with auto-set-on-update. TABLE::time_stamp holds offset in record + 1 for this field, and is used by handler code which performs updates required.
Actually SQL-99 says that we should allow niladic functions (like NOW()) as defaults for any field. Current limitations (only NOW() and only for one TIMESTAMP field) are because of restricted binary .frm format and should go away in the future.
Also because of this limitation of binary .frm format we use 5 different unireg_check values with TIMESTAMP field to distinguish various cases of DEFAULT or ON UPDATE values. These values are:
TIMESTAMP_OLD_FIELD - old timestamp, if there was not any fields with auto-set-on-update (or now() as default) in this table before, then this field has NOW() as default and is updated when row changes, else it is field which has 0 as default value and is not automatically updated. TIMESTAMP_DN_FIELD - field with NOW() as default but not set on update automatically (TIMESTAMP DEFAULT NOW()) TIMESTAMP_UN_FIELD - field which is set on update automatically but has not NOW() as default (but it may has 0 or some other const timestamp as default) (TIMESTAMP ON UPDATE NOW()). TIMESTAMP_DNUN_FIELD - field which has now() as default and is auto-set on update. (TIMESTAMP DEFAULT NOW() ON UPDATE NOW()) NONE - field which is not auto-set on update with some other than NOW() default value (TIMESTAMP DEFAULT 0).
Note that TIMESTAMP_OLD_FIELDs are never created explicitly now, they are left only for preserving ability to read old tables. Such fields replaced with their newer analogs in CREATE TABLE and in SHOW CREATE TABLE. This is because we want to prefer NONE unireg_check before TIMESTAMP_OLD_FIELD for "TIMESTAMP DEFAULT 'Const'" field. (Old timestamps allowed such specification too but ignored default value for first timestamp, which of course is non-standard.) In most cases user won't notice any change, only exception is different behavior of old/new timestamps during ALTER TABLE.
Definition at line 79 of file epoch.cc.