Below is the list of changes that have just been committed into a local
5.0 repository of martin. When martin does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-10-05 14:59:38+02:00, mhansson@stripped +4 -0
Bug#31160: MAKETIME() crashes server when returning NULL in ORDER BY using filesort
Even though it returns NULL, the MAKETIME function did not have this property set,
causing a failed assertion (designed to catch exactly this).
Fixed by setting the nullability property of MAKETIME().
mysql-test/r/func_sapdb.result@stripped, 2007-10-05 14:59:36+02:00, mhansson@stripped +1 -1
Bug#31160: Changed test result.
mysql-test/r/func_time.result@stripped, 2007-10-05 14:59:36+02:00, mhansson@stripped +9 -0
Bug#31160: Test result.
mysql-test/t/func_time.test@stripped, 2007-10-05 14:59:36+02:00, mhansson@stripped +10 -0
Bug#31160: Test case.
sql/item_timefunc.h@stripped, 2007-10-05 14:59:36+02:00, mhansson@stripped +4 -1
Bug#31160: The fix: Initializing maybe_null to true
diff -Nrup a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
--- a/mysql-test/r/func_sapdb.result 2007-05-16 10:44:34 +02:00
+++ b/mysql-test/r/func_sapdb.result 2007-10-05 14:59:36 +02:00
@@ -196,7 +196,7 @@ f2 datetime YES NULL
f3 time YES NULL
f4 time YES NULL
f5 time YES NULL
-f6 time NO 00:00:00
+f6 time YES NULL
f7 datetime YES NULL
f8 date YES NULL
f9 time YES NULL
diff -Nrup a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
--- a/mysql-test/r/func_time.result 2007-08-03 18:59:11 +02:00
+++ b/mysql-test/r/func_time.result 2007-10-05 14:59:36 +02:00
@@ -1027,6 +1027,15 @@ fmtddate field2
Sep-4 12:00AM abcd
DROP TABLE testBug8868;
SET NAMES DEFAULT;
+CREATE TABLE t1 (
+a TIMESTAMP
+);
+INSERT INTO t1 VALUES (now()), (now());
+SELECT * FROM t1 ORDER BY MAKETIME(1, 1, a);
+a
+2007-10-05 06:25:37
+2007-10-05 06:25:37
+DROP TABLE t1;
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H)
union
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 DAY)),'%H') As H);
diff -Nrup a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
--- a/mysql-test/t/func_time.test 2007-08-03 18:59:11 +02:00
+++ b/mysql-test/t/func_time.test 2007-10-05 14:59:36 +02:00
@@ -545,6 +545,16 @@ DROP TABLE testBug8868;
SET NAMES DEFAULT;
+#
+# Bug #31160: MAKETIME() crashes server when returning NULL in ORDER BY using
+# filesort
+#
+CREATE TABLE t1 (
+ a TIMESTAMP
+);
+INSERT INTO t1 VALUES (now()), (now());
+SELECT * FROM t1 ORDER BY MAKETIME(1, 1, a);
+DROP TABLE t1;
#
# Bug #19844 time_format in Union truncates values
diff -Nrup a/sql/item_timefunc.h b/sql/item_timefunc.h
--- a/sql/item_timefunc.h 2007-05-16 10:44:40 +02:00
+++ b/sql/item_timefunc.h 2007-10-05 14:59:36 +02:00
@@ -962,7 +962,10 @@ class Item_func_maketime :public Item_st
{
public:
Item_func_maketime(Item *a, Item *b, Item *c)
- :Item_str_timefunc(a, b ,c) {}
+ :Item_str_timefunc(a, b, c)
+ {
+ maybe_null= TRUE;
+ }
String *val_str(String *str);
const char *func_name() const { return "maketime"; }
};
| Thread |
|---|
| • bk commit into 5.0 tree (mhansson:1.2530) BUG#31160 | mhansson | 5 Oct |