From 609a3cd2953458626065e1f0b288c1dc5bd3e877 Mon Sep 17 00:00:00 2001 From: "kaa@polly.local" <> Date: Wed, 4 Oct 2006 17:13:32 +0400 Subject: Fixes a number of problems with time/datetime <-> string conversion functions: - bug #11655 "Wrong time is returning from nested selects - maximum time exists - input and output TIME values were not validated properly in several conversion functions - bug #20927 "sec_to_time treats big unsigned as signed" - integer overflows were not checked in several functions. As a result, input values like 2^32 or 3600*2^32 were treated as 0 - BIGINT UNSIGNED values were treated as SIGNED in several functions - in cases where both input string truncation and out-of-range TIME value occur, only 'truncated incorrect time value' warning was produced --- sql/time.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/time.cc') diff --git a/sql/time.cc b/sql/time.cc index ef832ac5a70..ddc5e6435be 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -255,9 +255,9 @@ my_time_t TIME_to_timestamp(THD *thd, const TIME *t, bool *in_dst_time_gap) bool str_to_time_with_warn(const char *str, uint length, TIME *l_time) { - int was_cut; - bool ret_val= str_to_time(str, length, l_time, &was_cut); - if (was_cut) + int warning; + bool ret_val= str_to_time(str, length, l_time, &warning); + if (ret_val || warning) make_truncated_value_warning(current_thd, str, length, MYSQL_TIMESTAMP_TIME); return ret_val; } -- cgit v1.2.1