Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram 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, 2006-12-04 17:06:25+04:00, ramil@stripped +3 -0
fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values
Set null_value in case of wrong data.
mysql-test/r/cast.result@stripped, 2006-12-04 17:06:22+04:00, ramil@stripped +4 -0
fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values
- test result.
mysql-test/t/cast.test@stripped, 2006-12-04 17:06:23+04:00, ramil@stripped +7 -1
fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values
- test case.
sql/item_timefunc.cc@stripped, 2006-12-04 17:06:23+04:00, ramil@stripped +3 -0
fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values
- set null_value in case of error.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: ramil
# Host: myoffice.izhnet.ru
# Root: /usr/home/ram/work/bug23938/my41-bug23938
--- 1.110/sql/item_timefunc.cc 2006-12-04 17:06:32 +04:00
+++ 1.111/sql/item_timefunc.cc 2006-12-04 17:06:32 +04:00
@@ -2507,7 +2507,10 @@ longlong Item_date_typecast::val_int()
DBUG_ASSERT(fixed == 1);
TIME ltime;
if (args[0]->get_date(<ime, TIME_FUZZY_DATE))
+ {
+ null_value= 1;
return 0;
+ }
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
}
--- 1.28/mysql-test/r/cast.result 2006-12-04 17:06:32 +04:00
+++ 1.29/mysql-test/r/cast.result 2006-12-04 17:06:32 +04:00
@@ -278,3 +278,7 @@ double_val cast_val
-1e+30 -9223372036854775808
1e+30 9223372036854775807
DROP TABLE t1;
+select isnull(date(NULL)), isnull(cast(NULL as DATE));
+isnull(date(NULL)) isnull(cast(NULL as DATE))
+1 1
+End of 4.1 tests
--- 1.22/mysql-test/t/cast.test 2006-12-04 17:06:33 +04:00
+++ 1.23/mysql-test/t/cast.test 2006-12-04 17:06:33 +04:00
@@ -167,4 +167,10 @@ INSERT INTO t1 SET f1 = +1.0e+30 ;
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
DROP TABLE t1;
-# End of 4.1 tests
+#
+# Bug #23938: cast(NULL as DATE)
+#
+
+select isnull(date(NULL)), isnull(cast(NULL as DATE));
+
+--echo End of 4.1 tests
| Thread |
|---|
| • bk commit into 4.1 tree (ramil:1.2555) BUG#23938 | ramil | 4 Dec |