diff options
author | kaa@polly.local <> | 2006-10-04 17:13:32 +0400 |
---|---|---|
committer | kaa@polly.local <> | 2006-10-04 17:13:32 +0400 |
commit | 609a3cd2953458626065e1f0b288c1dc5bd3e877 (patch) | |
tree | 8b8e52453890c27a4b5e0e288b80cc0ccc883b0a /sql/time.cc | |
parent | 66fa757e1f6a3d9373119ac5437e490ead191411 (diff) | |
download | mariadb-git-609a3cd2953458626065e1f0b288c1dc5bd3e877.tar.gz |
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
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |