diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-06-15 11:04:06 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-06-15 11:04:06 +0400 |
commit | 43e45226722d69c3a1e6fa59381f068fe7418253 (patch) | |
tree | 140d18d5598e5c5defd508ae5d09658b7c8075c9 /sql-common | |
parent | f69f3db7f3bbfee42096d781c6a7c43618cc9a34 (diff) | |
download | mariadb-git-43e45226722d69c3a1e6fa59381f068fe7418253.tar.gz |
MDEV-8205 timediff returns null when comparing decimal time to time string value
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/my_time.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 6a011df795a..28757a2c96c 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1314,16 +1314,8 @@ int number_to_time(my_bool neg, ulonglong nr, ulong sec_part, MYSQL_TIME *ltime, int *was_cut) { if (nr > 9999999 && nr < 99991231235959ULL && neg == 0) - { - if (number_to_datetime(nr, sec_part, ltime, - TIME_INVALID_DATES, was_cut) < 0) - return -1; - - ltime->year= ltime->month= ltime->day= 0; - ltime->time_type= MYSQL_TIMESTAMP_TIME; - *was_cut= MYSQL_TIME_NOTE_TRUNCATED; - return 0; - } + return number_to_datetime(nr, sec_part, ltime, + TIME_INVALID_DATES, was_cut) < 0 ? -1 : 0; *was_cut= 0; ltime->year= ltime->month= ltime->day= 0; |