diff options
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 08f2a332556..7b439aeebdb 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1911,17 +1911,14 @@ bool Item_func_convert_tz::get_date(TIME *ltime, return 1; } - /* Check if we in range where we treat datetime values as non-UTC */ - if (ltime->year < TIMESTAMP_MAX_YEAR && ltime->year > TIMESTAMP_MIN_YEAR || - ltime->year==TIMESTAMP_MAX_YEAR && ltime->month==1 && ltime->day==1 || - ltime->year==TIMESTAMP_MIN_YEAR && ltime->month==12 && ltime->day==31) { my_bool not_used; my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); - if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <= TIMESTAMP_MAX_VALUE) + /* my_time_tmp is guranteed to be in the allowed range */ + if (my_time_tmp) to_tz->gmt_sec_to_TIME(ltime, my_time_tmp); } - + null_value= 0; return 0; } |