Commit 918f506b authored by unknown's avatar unknown

Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt

into  moonbone.local:/mnt/gentoo64/work/29729-bug-5.0-opt-mysql
parents 41373fa4 766d0aee
...@@ -109,3 +109,16 @@ select 1 from t1 where cast('100:00:00' as time) between f1 and f2; ...@@ -109,3 +109,16 @@ select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
1 1
1 1
drop table t1; drop table t1;
CREATE TABLE t1 (
f2 date NOT NULL,
f3 int(11) unsigned NOT NULL default '0',
PRIMARY KEY (f3, f2)
);
insert into t1 values('2007-07-01', 1);
insert into t1 values('2007-07-01', 2);
insert into t1 values('2007-07-02', 1);
insert into t1 values('2007-07-02', 2);
SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
sum(f3)
3
drop table t1;
...@@ -58,3 +58,18 @@ create table t1(f1 time, f2 time); ...@@ -58,3 +58,18 @@ create table t1(f1 time, f2 time);
insert into t1 values('20:00:00','150:00:00'); insert into t1 values('20:00:00','150:00:00');
select 1 from t1 where cast('100:00:00' as time) between f1 and f2; select 1 from t1 where cast('100:00:00' as time) between f1 and f2;
drop table t1; drop table t1;
#
# Bug#29729: Wrong conversion error led to an empty result set.
#
CREATE TABLE t1 (
f2 date NOT NULL,
f3 int(11) unsigned NOT NULL default '0',
PRIMARY KEY (f3, f2)
);
insert into t1 values('2007-07-01', 1);
insert into t1 values('2007-07-01', 2);
insert into t1 values('2007-07-02', 1);
insert into t1 values('2007-07-02', 2);
SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2;
drop table t1;
...@@ -5271,7 +5271,8 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) ...@@ -5271,7 +5271,8 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs)
else else
{ {
tmp= l_time.day + l_time.month*32 + l_time.year*16*32; tmp= l_time.day + l_time.month*32 + l_time.year*16*32;
if (!error && (ret != MYSQL_TIMESTAMP_DATE)) if (!error && (ret != MYSQL_TIMESTAMP_DATE) &&
thd->count_cuted_fields != CHECK_FIELD_IGNORE)
error= 3; // Datetime was cut (note) error= 3; // Datetime was cut (note)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment