diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-08-11 06:47:48 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-08-11 06:47:48 +0400 |
commit | 2085f14a8dddf175765d97dcb5306bc2a0578b00 (patch) | |
tree | 24979de5af9a1fef91752d548be6a296e68338c1 /sql/sql_time.cc | |
parent | 2966c1e422866f48b68e109ac9e27d52be77fb60 (diff) | |
download | mariadb-git-2085f14a8dddf175765d97dcb5306bc2a0578b00.tar.gz |
MDEV-16938 Move Item::get_time_with_conversion() to Time
The affected code is well covered by tests for MDEV-8766.
Adding only the missing part: the old mode OLD_MODE_ZERO_DATE_TIME_CAST
in combination with 0000-MM-00 and YYYY-00-00.
The old mode in combination with 0000-00-DD was already covered,
so was the new mode with all types of DATETIME values.
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r-- | sql/sql_time.cc | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc index c75b8b19e1a..430eb192052 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -1365,26 +1365,6 @@ time_to_datetime_with_warn(THD *thd, } -bool datetime_to_time_with_warn(THD *thd, const MYSQL_TIME *dt, - MYSQL_TIME *tm, uint dec) -{ - if (thd->variables.old_behavior & OLD_MODE_ZERO_DATE_TIME_CAST) - { - *tm= *dt; - datetime_to_time(tm); - return false; - } - else /* new mode */ - { - MYSQL_TIME current_date; - set_current_date(thd, ¤t_date); - calc_time_diff(dt, ¤t_date, 1, tm, 0); - } - int warnings= 0; - return check_time_range(tm, dec, &warnings); -} - - longlong pack_time(const MYSQL_TIME *my_time) { return ((((((my_time->year * 13ULL + |