#At file:///work/bzrroot/mysql-next-mr-bugfixing/ based on revid:epotemkin@stripped
3241 Evgeny Potemkin 2010-08-25 [merge]
Auto-merged.
modified:
mysql-test/r/func_group.result
mysql-test/t/func_group.test
sql/item.cc
=== modified file 'mysql-test/r/func_group.result'
--- a/mysql-test/r/func_group.result 2010-08-13 08:15:36 +0000
+++ b/mysql-test/r/func_group.result 2010-08-25 08:07:14 +0000
@@ -1725,7 +1725,7 @@ SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a
1
DROP TABLE t1;
#
-# 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');
@@ -1735,3 +1735,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
=== modified file 'mysql-test/t/func_group.test'
--- a/mysql-test/t/func_group.test 2010-08-06 07:35:21 +0000
+++ b/mysql-test/t/func_group.test 2010-08-25 08:07:14 +0000
@@ -1097,7 +1097,7 @@ SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a
DROP TABLE t1;
--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');
@@ -1106,3 +1106,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
+
=== modified file 'sql/item.cc'
--- a/sql/item.cc 2010-08-14 09:38:42 +0000
+++ b/sql/item.cc 2010-08-25 08:07:14 +0000
@@ -7582,9 +7582,14 @@ String *Item_cache_datetime::val_str(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;
Attachment: [text/bzr-bundle] bzr/epotemkin@mysql.com-20100825080714-bsj3pxk4wphz040r.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr-bugfixing branch (epotemkin:3241) | Evgeny Potemkin | 25 Aug |