diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-09-10 10:08:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-09-10 10:08:11 +0400 |
commit | 8b5da9f73b4af8e5a11fdddc402da822d3df8d93 (patch) | |
tree | f798f6c91602a458e9fa36544e2cf6c3b2a6e0cc /sql/item_timefunc.h | |
parent | 42f56557f59705aeec83a54f02399b04d52e9eea (diff) | |
parent | c2b38529a9ca2ea09dfa73186d9350a0d6dcd6ac (diff) | |
download | mariadb-git-8b5da9f73b4af8e5a11fdddc402da822d3df8d93.tar.gz |
Merge from 5.3
pending merges:
Alexander Barkov 2013-09-09 MDEV-4863 COALESCE(time_or_datetime) returns...
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index 8bea068357b..8f7b65b253a 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -30,19 +30,17 @@ enum date_time_format_types TIME_ONLY= 0, TIME_MICROSECOND, DATE_ONLY, DATE_TIME, DATE_TIME_MICROSECOND }; -static inline enum enum_mysql_timestamp_type -mysql_type_to_time_type(enum enum_field_types mysql_type) + +static inline uint +mysql_temporal_int_part_length(enum enum_field_types mysql_type) { - switch(mysql_type) { - case MYSQL_TYPE_TIME: return MYSQL_TIMESTAMP_TIME; - case MYSQL_TYPE_TIMESTAMP: - case MYSQL_TYPE_DATETIME: return MYSQL_TIMESTAMP_DATETIME; - case MYSQL_TYPE_NEWDATE: - case MYSQL_TYPE_DATE: return MYSQL_TIMESTAMP_DATE; - default: return MYSQL_TIMESTAMP_ERROR; - } + static uint max_time_type_width[5]= + { MAX_DATETIME_WIDTH, MAX_DATETIME_WIDTH, MAX_DATE_WIDTH, + MAX_DATETIME_WIDTH, MIN_TIME_WIDTH }; + return max_time_type_width[mysql_type_to_time_type(mysql_type)+2]; } + bool get_interval_value(Item *args,interval_type int_type, INTERVAL *interval); class Item_func_period_add :public Item_int_func @@ -421,9 +419,11 @@ public: max_length=17 + (decimals ? decimals + 1 : 0); set_persist_maybe_null(1); } - void find_num_type() { hybrid_type= decimals ? DECIMAL_RESULT : INT_RESULT; } + void find_num_type() + { cached_result_type= decimals ? DECIMAL_RESULT : INT_RESULT; } double real_op() { DBUG_ASSERT(0); return 0; } String *str_op(String *str) { DBUG_ASSERT(0); return 0; } + bool date_op(MYSQL_TIME *ltime, uint fuzzydate) { DBUG_ASSERT(0); return true; } }; |