My Project
|
Public Member Functions | |
Field_timestampf (uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, enum utype unireg_check_arg, const char *field_name_arg, uint8 dec_arg) | |
Field_timestampf (bool maybe_null_arg, const char *field_name_arg, uint8 dec_arg) | |
Field_timestampf * | clone (MEM_ROOT *mem_root) const |
Field_timestampf * | clone () const |
enum_field_types | type () const |
enum_field_types | real_type () const |
enum_field_types | binlog_type () const |
bool | zero_pack () const |
uint32 | pack_length () const |
virtual uint | pack_length_from_metadata (uint field_metadata) |
type_conversion_status | reset () |
type_conversion_status | store_packed (longlong nr) |
bool | get_date (MYSQL_TIME *ltime, uint fuzzydate) |
void | sql_type (String &str) const |
bool | get_timestamp (struct timeval *tm, int *warnings) |
virtual type_conversion_status | validate_stored_val (THD *thd) |
Static Public Attributes | |
static const int | PACK_LENGTH = 8 |
Protected Member Functions | |
bool | get_date_internal (MYSQL_TIME *ltime) |
type_conversion_status | store_internal (const MYSQL_TIME *ltime, int *error) |
ulonglong | date_flags (const THD *thd) |
void | store_timestamp_internal (const struct timeval *tm) |
Field_timestampf::Field_timestampf | ( | uchar * | ptr_arg, |
uchar * | null_ptr_arg, | ||
uchar | null_bit_arg, | ||
enum utype | unireg_check_arg, | ||
const char * | field_name_arg, | ||
uint8 | dec_arg | ||
) |
Field_timestampf::Field_timestampf | ( | bool | maybe_null_arg, |
const char * | field_name_arg, | ||
uint8 | dec_arg | ||
) |
Field_timestampf constructor
Field_timestampf* Field_timestampf::clone | ( | MEM_ROOT * | mem_root | ) | const [inline, virtual] |
Makes a shallow copy of the Field object.
mem_root | MEM_ROOT to use for memory allocation. |
NULL | If memory allocation failed. |
Implements Field.
Field_timestampf* Field_timestampf::clone | ( | ) | const [inline, virtual] |
Makes a shallow copy of the Field object.
NULL | If memory allocation failed. |
Implements Field.
ulonglong Field_timestampf::date_flags | ( | const THD * | thd | ) | [protected, virtual] |
Flags that are passed as "flag" argument to check_date(), number_to_datetime(), str_to_datetime().
Flags depend on the session sql_mode settings, such as MODE_NO_ZERO_DATE, MODE_NO_ZERO_IN_DATE. Also, Field_newdate, Field_datetime, Field_datetimef add TIME_FUZZY_DATE to the session sql_mode settings, to allow relaxed date format, while Field_timestamp, Field_timestampf do not.
thd | THD |
sql_mode | flags mixed with the field type flags. |
Reimplemented from Field_temporal.
bool Field_timestampf::get_date_internal | ( | MYSQL_TIME * | ltime | ) | [protected, virtual] |
Low level function to get value into MYSQL_TIME, without checking for being valid.
Implements Field_temporal_with_date.
bool Field_timestampf::get_timestamp | ( | struct timeval * | tm, |
int * | warnings | ||
) | [virtual] |
Returns timestamp value in "struct timeval" format. This method is used in "SELECT UNIX_TIMESTAMP(field)" to avoid conversion from timestamp to MYSQL_TIME and back.
Reimplemented from Field.
type_conversion_status Field_timestampf::store_internal | ( | const MYSQL_TIME * | ltime, |
int * | error | ||
) | [protected, virtual] |
Low level routine to store a MYSQL_TIME value into a field. The value must be already properly rounded or truncated and checked for being a valid TIME/DATE/DATETIME value.
IN | ltime MYSQL_TIME value. |
OUT | error Error flag vector, set in case of error. |
false | In case of success. |
true | In case of error. |
Implements Field_temporal.
type_conversion_status Field_timestampf::store_packed | ( | longlong | nr | ) | [virtual] |
Store a temporal value in packed longlong format into a field. The packed value is compatible with TIME_to_longlong_time_packed(), TIME_to_longlong_date_packed() or TIME_to_longlong_datetime_packed(). Note, the value must be properly rounded or truncated according according to field->decimals().
nr | temporal value in packed longlong format. |
false | on success |
true | on error |
Reimplemented from Field.
void Field_timestampf::store_timestamp_internal | ( | const struct timeval * | tm | ) | [protected, virtual] |
Store "struct timeval" value into field. The value must be properly rounded or truncated according to the number of fractional second digits.
Implements Field_temporal_with_date_and_time.
type_conversion_status Field_timestampf::validate_stored_val | ( | THD * | thd | ) | [virtual] |
Validate date value stored in the field.
Now we check whether date value is zero or has zero in date or not and set warning/error message appropriately(depending on the sql_mode).
Reimplemented from Field_temporal_with_date.