diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-02-04 10:49:44 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-02-04 10:49:44 +0100 |
commit | 5475cc7765aff75dedb2c67f263d22dbbe78c0b5 (patch) | |
tree | aaf573207f5accd08d8982ff79cf90080b5d5657 /sql/item_timefunc.cc | |
parent | 7dab4d100a9542c64b4b0bfc9feb72ac50aa456f (diff) | |
parent | 3b3a7a524e6a4def53aa98e93bd6e930df60eec3 (diff) | |
download | mariadb-git-5475cc7765aff75dedb2c67f263d22dbbe78c0b5.tar.gz |
merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index a9d519f9b60..40929c12e3c 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2627,7 +2627,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 (cached_field_type == MYSQL_TYPE_DATETIME) { @@ -2680,16 +2680,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, Sql_condition::WARN_LEVEL_WARN, - &str, MYSQL_TIMESTAMP_TIME, NullS); - - return (null_value= 0); + return (null_value= adjust_time_range_with_warn(ltime, decimals)); } @@ -2727,7 +2718,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); @@ -2771,12 +2762,7 @@ 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); - - if (was_cut) - make_truncated_value_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, - &str, MYSQL_TIMESTAMP_TIME, NullS); - return (null_value= 0); + return (null_value= adjust_time_range_with_warn(ltime, decimals)); } /** |