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-04 09:15:26+02:00, mhansson@stripped +3 -0
Bug #30942: select str_to_date from derived table returns varying results
The function str_to_date has a field to say whether it's invoked constant
arguments. But this member was not initialized, causing the function to
think that it could use a cache of the format type when said cache was in
fact not initialized.
Fixed by initializing the field to false.
mysql-test/r/type_date.result@stripped, 2007-10-04 09:15:24+02:00, mhansson@stripped +10 -0
Bug#30942: Test result
mysql-test/t/type_date.test@stripped, 2007-10-04 09:15:25+02:00, mhansson@stripped +13 -0
Bug#30942: Test case
sql/item_timefunc.h@stripped, 2007-10-04 09:15:25+02:00, mhansson@stripped +1 -1
Bug#30942: Initialized const_item to false
diff -Nrup a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
--- a/mysql-test/r/type_date.result 2007-05-16 10:44:36 +02:00
+++ b/mysql-test/r/type_date.result 2007-10-04 09:15:24 +02:00
@@ -136,3 +136,13 @@ d dt ts
0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00
2001-11-11 2001-11-11 00:00:00 2001-11-11 00:00:00
drop table t1;
+CREATE TABLE t1 (
+a INT
+);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL);
+SELECT str_to_date( '', a ) FROM t1;
+str_to_date( '', a )
+0000-00-00 00:00:00
+NULL
+DROP TABLE t1;
diff -Nrup a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
--- a/mysql-test/t/type_date.test 2007-05-16 10:44:37 +02:00
+++ b/mysql-test/t/type_date.test 2007-10-04 09:15:25 +02:00
@@ -136,3 +136,16 @@ insert into t1 values (9912101,9912101,9
insert into t1 values (11111,11111,11111);
select * from t1;
drop table t1;
+
+#
+# Bug #30942: select str_to_date from derived table returns varying results
+#
+CREATE TABLE t1 (
+ a INT
+);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (NULL);
+
+SELECT str_to_date( '', a ) FROM t1;
+DROP TABLE t1;
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-04 09:15:25 +02:00
@@ -1030,7 +1030,7 @@ class Item_func_str_to_date :public Item
bool const_item;
public:
Item_func_str_to_date(Item *a, Item *b)
- :Item_str_func(a, b)
+ :Item_str_func(a, b), const_item(false)
{}
String *val_str(String *str);
bool get_date(MYSQL_TIME *ltime, uint fuzzy_date);
| Thread |
|---|
| • bk commit into 5.0 tree (mhansson:1.2490) BUG#30942 | mhansson | 4 Oct |