mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/29898-bug-5.0-opt-mysql
This commit is contained in:
@ -403,4 +403,15 @@ hex(cast('a' as binary(2)))
|
|||||||
select hex(cast('a' as char(2) binary));
|
select hex(cast('a' as char(2) binary));
|
||||||
hex(cast('a' as char(2) binary))
|
hex(cast('a' as char(2) binary))
|
||||||
61
|
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
|
End of 5.0 tests
|
||||||
|
@ -237,4 +237,13 @@ select hex(cast('a' as char(2) binary));
|
|||||||
select hex(cast('a' as binary(2)));
|
select hex(cast('a' as binary(2)));
|
||||||
select hex(cast('a' as char(2) binary));
|
select hex(cast('a' as char(2) binary));
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
|
||||||
|
#
|
||||||
|
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;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo End of 5.0 tests
|
--echo End of 5.0 tests
|
||||||
|
@ -2662,11 +2662,8 @@ longlong Item_date_typecast::val_int()
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed == 1);
|
DBUG_ASSERT(fixed == 1);
|
||||||
MYSQL_TIME ltime;
|
MYSQL_TIME ltime;
|
||||||
if (args[0]->get_date(<ime, TIME_FUZZY_DATE))
|
if ((null_value= args[0]->get_date(<ime, TIME_FUZZY_DATE)))
|
||||||
{
|
|
||||||
null_value= 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
|
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user