diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-06-20 09:48:34 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-06-20 09:48:34 +0400 |
commit | cfbd714868d6af284f1acfff361c098cbc525fff (patch) | |
tree | 3b102963548e759c5859ff155e7e2377d6574c4c /sql/item_timefunc.cc | |
parent | 02979daab48d871e8c43a227b8f4462128439f17 (diff) | |
download | mariadb-git-cfbd714868d6af284f1acfff361c098cbc525fff.tar.gz |
MDEV-19774 Assertion `sec.se c() <= 0x7FFFFFFFL' failed in Item_func_from_unixtime::get_date
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 81d5bfed981..2c527154108 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1933,7 +1933,7 @@ bool Item_func_from_unixtime::get_date(THD *thd, MYSQL_TIME *ltime, ltime->time_type= MYSQL_TIMESTAMP_TIME; VSec9 sec(thd, args[0], "unixtime", TIMESTAMP_MAX_VALUE); - DBUG_ASSERT(sec.sec() <= TIMESTAMP_MAX_VALUE); + DBUG_ASSERT(sec.is_null() || sec.sec() <= TIMESTAMP_MAX_VALUE); if (sec.is_null() || sec.truncated() || sec.neg()) return (null_value= 1); @@ -2601,8 +2601,8 @@ bool Item_func_maketime::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzy return (null_value= 1); int warn; - new(ltime) Time(&warn, hour.neg(), hour.abs(), (uint) minute, sec, - thd->temporal_round_mode(), decimals); + new(ltime) Time(&warn, hour.neg(), hour.abs(), (uint) minute, + sec.to_const_sec9(), thd->temporal_round_mode(), decimals); if (warn) { // use check_time_range() to set ltime to the max value depending on dec |