mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
The Item_date_typecast::val_int function doesn't reset null_value flag. This makes all values that follows the first null value to be treated as nulls and led to a wrong result. Now the Item_date_typecast::val_int function correctly sets the null_value flag for both null and non-null values. mysql-test/t/cast.test: Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. mysql-test/r/cast.result: Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. sql/item_timefunc.cc: Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. Now the Item_date_typecast::val_int function correctly sets the null_value flag for both null and non-null values.
This commit is contained in:
@ -403,4 +403,15 @@ hex(cast('a' as binary(2)))
|
||||
select hex(cast('a' as char(2) binary));
|
||||
hex(cast('a' as char(2) binary))
|
||||
61
|
||||
CREATE TABLE t1 (d1 datetime);
|
||||
INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
|
||||
('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
|
||||
SELECT cast(date(d1) as signed) FROM t1;
|
||||
cast(date(d1) as signed)
|
||||
20070719
|
||||
NULL
|
||||
20070719
|
||||
NULL
|
||||
20070719
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user