diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-06-09 17:23:39 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-06-09 17:23:39 +0200 |
commit | c3f665dc66d7ddb068875be9e78eb9b7a0d250e6 (patch) | |
tree | 409ebafb1a45415e89137c3066110afaa94420ae /sql/item_func.cc | |
parent | 9b98cae4cc44fa39813675b361b7aa65d129b29d (diff) | |
download | mariadb-git-c3f665dc66d7ddb068875be9e78eb9b7a0d250e6.tar.gz |
bugfixes:
microsecond(TIME)
alter table datetime<->datetime(6)
max(TIME), mix(TIME)
mysql-test/t/func_if.test:
fix the test case of avoid overflow
sql/field.cc:
don't use make_date() and make_time()
sql/field.h:
correct eq_def() for temporal fields
sql/item.cc:
move datetime caching from Item_cache_int
to Item_cache_temporal
sql/item.h:
move datetime caching from Item_cache_int
to Item_cache_temporal
sql/item_func.cc:
use existing helper methods, don't duplicate
sql/item_sum.cc:
argument cache must use argument's cmp_type, not result_type.
sql/item_timefunc.cc:
use existing methods, don't tuplicate.
remove unused function.
fix micorseconds() to support TIME argument
sql/mysql_priv.h:
dead code
sql/time.cc:
dead code
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 8b28843197d..0d97af72dd3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2463,41 +2463,14 @@ String *Item_func_min_max::val_str(String *str) { DBUG_ASSERT(fixed == 1); if (compare_as_dates) - { - MYSQL_TIME ltime; - if (get_date(<ime, TIME_FUZZY_DATE)) - return 0; - - str->alloc(MAX_DATE_STRING_REP_LENGTH); - str->set_charset(collation.collation); - str->length(my_TIME_to_str(<ime, const_cast<char*>(str->ptr()), decimals)); - return str; - } + return val_string_from_date(str); switch (cmp_type) { case INT_RESULT: - { - longlong nr=val_int(); - if (null_value) - return 0; - str->set_int(nr, unsigned_flag, &my_charset_bin); - return str; - } + return val_string_from_int(str); case DECIMAL_RESULT: - { - my_decimal dec_buf, *dec_val= val_decimal(&dec_buf); - if (null_value) - return 0; - my_decimal2string(E_DEC_FATAL_ERROR, dec_val, 0, 0, 0, str); - return str; - } + return val_string_from_decimal(str); case REAL_RESULT: - { - double nr= val_real(); - if (null_value) - return 0; /* purecov: inspected */ - str->set_real(nr,decimals,&my_charset_bin); - return str; - } + return val_string_from_real(str); case STRING_RESULT: { String *UNINIT_VAR(res); |