mirror of
https://github.com/MariaDB/server.git
synced 2026-04-24 09:15:30 +02:00
Cherry-pick patch for Bug#56120 from mysql-5.5-bugfixing.
This commit is contained in:
parent
e924c91e57
commit
02890f0b90
3 changed files with 28 additions and 4 deletions
|
|
@ -1715,7 +1715,7 @@ drop table t1;
|
|||
#
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug#55648: Server crash on MIX/MAX on maximum time value
|
||||
# Bug#55648: Server crash on MIN/MAX on maximum time value
|
||||
#
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('837:59:59');
|
||||
|
|
@ -1725,3 +1725,13 @@ MAX(c1)
|
|||
838:59:59
|
||||
DROP TABLE t1;
|
||||
# End of the bug#55648
|
||||
#
|
||||
# Bug#56120: Failed assertion on MIN/MAX on negative time value
|
||||
#
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('-00:00:01');
|
||||
SELECT MAX(c1),MIN(c1) FROM t1;
|
||||
MAX(c1) MIN(c1)
|
||||
-00:00:01 -00:00:01
|
||||
DROP TABLE t1;
|
||||
# End of the bug#56120
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ drop table t1;
|
|||
--echo End of 5.1 tests
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55648: Server crash on MIX/MAX on maximum time value
|
||||
--echo # Bug#55648: Server crash on MIN/MAX on maximum time value
|
||||
--echo #
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('837:59:59');
|
||||
|
|
@ -1095,3 +1095,12 @@ SELECT MAX(c1) FROM t1;
|
|||
DROP TABLE t1;
|
||||
--echo # End of the bug#55648
|
||||
|
||||
--echo #
|
||||
--echo # Bug#56120: Failed assertion on MIN/MAX on negative time value
|
||||
--echo #
|
||||
CREATE TABLE t1(c1 TIME NOT NULL);
|
||||
INSERT INTO t1 VALUES('-00:00:01');
|
||||
SELECT MAX(c1),MIN(c1) FROM t1;
|
||||
DROP TABLE t1;
|
||||
--echo # End of the bug#56120
|
||||
|
||||
|
|
|
|||
|
|
@ -7510,9 +7510,14 @@ String *Item_cache_datetime::val_str(String *str)
|
|||
return NULL;
|
||||
if (cached_field_type == MYSQL_TYPE_TIME)
|
||||
{
|
||||
ulonglong time= int_value;
|
||||
DBUG_ASSERT(time <= TIME_MAX_VALUE);
|
||||
longlong time= int_value;
|
||||
set_zero_time(<ime, MYSQL_TIMESTAMP_TIME);
|
||||
if (time < 0)
|
||||
{
|
||||
time= -time;
|
||||
ltime.neg= TRUE;
|
||||
}
|
||||
DBUG_ASSERT(time <= TIME_MAX_VALUE);
|
||||
ltime.second= time % 100;
|
||||
time/= 100;
|
||||
ltime.minute= time % 100;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue