summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-06-09 17:23:39 +0200
committerSergei Golubchik <sergii@pisem.net>2011-06-09 17:23:39 +0200
commitaeb256fb27a3b3a87ebd9a1ed4367b012232c6a6 (patch)
tree409ebafb1a45415e89137c3066110afaa94420ae /sql/item_timefunc.cc
parent0a0aeb08e5f450111ee4b369b50db668d245ad02 (diff)
downloadmariadb-git-aeb256fb27a3b3a87ebd9a1ed4367b012232c6a6.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_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 064b630a4f5..b080f2e9707 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -35,16 +35,6 @@
/** Day number for Dec 31st, 9999. */
#define MAX_DAY_NUMBER 3652424L
-static bool make_datetime(MYSQL_TIME *ltime, String *str, uint decimals)
-{
- if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
- return 1;
- str->length(my_TIME_to_str(ltime, const_cast<char*>(str->ptr()), decimals));
- str->set_charset(&my_charset_bin);
- return 0;
-}
-
-
/*
Date formats corresponding to compound %r and %T conversion specifiers
@@ -1370,15 +1360,7 @@ bool get_interval_value(Item *args,interval_type int_type,
String *Item_temporal_func::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- MYSQL_TIME ltime;
- if (get_date(&ltime, TIME_FUZZY_DATE))
- return (String *) 0;
- if (make_datetime(&ltime, str, decimals))
- {
- null_value= 1;
- return (String *) 0;
- }
- return str;
+ return val_string_from_date(str);
}
@@ -2672,7 +2654,7 @@ longlong Item_func_microsecond::val_int()
{
DBUG_ASSERT(fixed == 1);
MYSQL_TIME ltime;
- if (!get_arg0_date(&ltime, TIME_FUZZY_DATE))
+ if (!get_arg0_date(&ltime, TIME_TIME_ONLY))
return ltime.second_part;
return 0;
}