diff options
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index febc92e34f6..68eb2178804 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1827,15 +1827,10 @@ 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_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); - if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <= TIMESTAMP_MAX_VALUE) - to_tz->gmt_sec_to_TIME(ltime, my_time_tmp); - } + my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used); + /* 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; |