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.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 4b10675c48d..9758d86213d 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2574,7 +2574,7 @@ bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
bool is_time= 0;
long days, microseconds;
longlong seconds;
- int l_sign= sign, was_cut= 0;
+ int l_sign= sign;
if (is_date) // TIMESTAMP function
{
@@ -2625,16 +2625,7 @@ bool Item_func_add_time::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
}
ltime->hour+= days*24;
-
- MYSQL_TIME copy= *ltime;
- ErrConvTime str(&copy);
-
- check_time_range(ltime, decimals, &was_cut);
- if (was_cut)
- make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- &str, MYSQL_TIMESTAMP_TIME, NullS);
-
- return (null_value= 0);
+ return (null_value= adjust_time_range_with_warn(ltime, decimals));
}
@@ -2672,7 +2663,7 @@ bool Item_func_timediff::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
DBUG_ASSERT(fixed == 1);
longlong seconds;
long microseconds;
- int l_sign= 1, was_cut= 0;
+ int l_sign= 1;
MYSQL_TIME l_time1,l_time2,l_time3;
ErrConvTime str(&l_time3);
@@ -2716,12 +2707,8 @@ bool Item_func_timediff::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
return (null_value= 1);
*ltime= l_time3;
- check_time_range(ltime, decimals, &was_cut);
+ return (null_value= adjust_time_range_with_warn(ltime, decimals));
- if (was_cut)
- make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- &str, MYSQL_TIMESTAMP_TIME, NullS);
- return (null_value= 0);
}
/**