diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-01 00:54:03 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-01 00:54:03 +0100 |
commit | 59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5 (patch) | |
tree | 3e4a302ccf3912d4d8a40aa271414003bfe7c9b6 /sql/item_timefunc.cc | |
parent | ce02738d7f2f2688eeec7004dd6a30293d36044f (diff) | |
parent | 6b6d40fa6ca1fe36f2a51c2723c58dfb3fc025bb (diff) | |
download | mariadb-git-59d9d08e2b6f6f35e781d24c47d33d26fb4ba2a5.tar.gz |
5.5 merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a3652ebf16e..63ad633cd2e 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(©); - - 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); } /** |