From 665004c8e0a83e72b735acd2721b91cc9e15e8a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 Dec 2006 17:06:25 +0400 Subject: 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: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - test result. mysql-test/t/cast.test: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - test case. sql/item_timefunc.cc: fix for bug #23938: ISNULL on DATE AND CAST AS DATE returns false for null values - set null_value in case of error. --- sql/item_timefunc.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/item_timefunc.cc') diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index c1bca7afc60..8687ccc5f10 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -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); } -- cgit v1.2.1