Loading mysql-test/r/cast.result +4 −0 Original line number Diff line number Diff line Loading @@ -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 mysql-test/t/cast.test +7 −1 Original line number Diff line number Diff line Loading @@ -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 sql/item_timefunc.cc +3 −0 Original line number Diff line number Diff line Loading @@ -2491,7 +2491,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); } Loading Loading
mysql-test/r/cast.result +4 −0 Original line number Diff line number Diff line Loading @@ -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
mysql-test/t/cast.test +7 −1 Original line number Diff line number Diff line Loading @@ -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
sql/item_timefunc.cc +3 −0 Original line number Diff line number Diff line Loading @@ -2491,7 +2491,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); } Loading