mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-17417 TIME(99991231235959) returns 838:59:59 instead of 23:59:58
This commit is contained in:
parent
be31c18e4a
commit
a53b99bf13
3 changed files with 12 additions and 1 deletions
|
@ -2088,5 +2088,11 @@ Warning 1292 Truncated incorrect time value: '-7487797330456870912'
|
|||
DROP TABLE t1;
|
||||
SET optimizer_use_condition_selectivity=DEFAULT;
|
||||
#
|
||||
# MDEV-17417 TIME(99991231235959) returns 838:59:59 instead of 23:59:58
|
||||
#
|
||||
SELECT TIME(99991231235957), TIME(99991231235958), TIME(99991231235959);
|
||||
TIME(99991231235957) TIME(99991231235958) TIME(99991231235959)
|
||||
23:59:57 23:59:58 23:59:59
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
|
|
|
@ -1361,6 +1361,11 @@ SELECT 1 FROM t1 WHERE it < -7487797330456870912;
|
|||
DROP TABLE t1;
|
||||
SET optimizer_use_condition_selectivity=DEFAULT;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-17417 TIME(99991231235959) returns 838:59:59 instead of 23:59:58
|
||||
--echo #
|
||||
SELECT TIME(99991231235957), TIME(99991231235958), TIME(99991231235959);
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
|
|
|
@ -1444,7 +1444,7 @@ longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
|
|||
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 (nr > 9999999 && nr <= 99991231235959ULL && neg == 0)
|
||||
return number_to_datetime(nr, sec_part, ltime,
|
||||
C_TIME_INVALID_DATES, was_cut) < 0 ? -1 : 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue