summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 37418e990a8..0d21d619421 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1486,7 +1486,8 @@ longlong Item_temporal_func::val_int()
MYSQL_TIME ltime;
if (get_date(&ltime, TIME_FUZZY_DATE | sql_mode))
return 0;
- return (longlong)TIME_to_ulonglong(&ltime);
+ longlong v= TIME_to_ulonglong(&ltime);
+ return ltime.neg ? -v : v;
}
@@ -2568,7 +2569,6 @@ bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
long days, microseconds;
longlong seconds;
int l_sign= sign, was_cut= 0;
- uint dec= decimals;
if (is_date) // TIMESTAMP function
{
@@ -2610,10 +2610,6 @@ bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
ltime->time_type= is_time ? MYSQL_TIMESTAMP_TIME : MYSQL_TIMESTAMP_DATETIME;
- if (cached_field_type == MYSQL_TYPE_STRING &&
- (l_time1.second_part || l_time2.second_part))
- dec= TIME_SECOND_PART_DIGITS;
-
if (!is_time)
{
get_date_from_daynr(days,&ltime->year,&ltime->month,&ltime->day);