summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-01-27 15:05:23 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-01-27 15:05:23 +0400
commit0ad8eaeb56a049df2947516d3d7ec49301d8d09d (patch)
tree151f9c4560a15f39d039061a4877e8775b6dc792 /sql/item_timefunc.cc
parentba3d0b173a5610905b31b78367c50700e8032b0b (diff)
parent7ea9d1e692c69c8715d98a9dbc44289d47a65447 (diff)
downloadmariadb-git-0ad8eaeb56a049df2947516d3d7ec49301d8d09d.tar.gz
Merge 5.3 -> 5.5
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);
}
/**