diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-09-20 16:51:56 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-09-20 16:51:56 +0400 |
commit | 935a163dd9242457fe56e73b2c2932230579aef5 (patch) | |
tree | d2e9ce4e9aa8d62573675c46241cec9473889c64 /sql/item_timefunc.cc | |
parent | 0c6455aa4658790439a58956f05df200a5e380b8 (diff) | |
download | mariadb-git-935a163dd9242457fe56e73b2c2932230579aef5.tar.gz |
MDEV-17244 MAKETIME(900,0,0.111) returns a wrong result
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index cc03cc004bd..2dc704f6873 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2765,9 +2765,10 @@ bool Item_func_maketime::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date) } else { - ltime->hour= TIME_MAX_HOUR; - ltime->minute= TIME_MAX_MINUTE; - ltime->second= TIME_MAX_SECOND; + // use check_time_range() to set ltime to the max value depending on dec + int unused; + ltime->hour= TIME_MAX_HOUR + 1; + check_time_range(ltime, decimals, &unused); char buf[28]; char *ptr= longlong10_to_str(hour.value(), buf, hour.is_unsigned() ? 10 : -10); int len = (int)(ptr - buf) + sprintf(ptr, ":%02u:%02u", (uint)minute, (uint)second); |