Commit b5b4f44a authored by serg@serg.mylan's avatar serg@serg.mylan

Merge bk-internal:/home/bk/mysql-4.0/

into serg.mylan:/usr/home/serg/Abk/mysql-4.0
parents da9d454c dcd13cf2
...@@ -52,10 +52,17 @@ a ...@@ -52,10 +52,17 @@ a
0000-00-00 00:00:00 0000-00-00 00:00:00
drop table t1; drop table t1;
create table t1 (id int, dt datetime); create table t1 (id int, dt datetime);
insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"); insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"),(4,"2003-09-15 01:20:30");
select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15'); select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15');
id dt id dt
1 2001-08-14 00:00:00 1 2001-08-14 00:00:00
create index dt on t1 (dt);
select * from t1 where dt > 20021020;
id dt
4 2003-09-15 01:20:30
select * from t1 ignore index (dt) where dt > 20021020;
id dt
4 2003-09-15 01:20:30
drop table t1; drop table t1;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`date` datetime NOT NULL default '0000-00-00 00:00:00', `date` datetime NOT NULL default '0000-00-00 00:00:00',
......
...@@ -36,8 +36,11 @@ drop table t1; ...@@ -36,8 +36,11 @@ drop table t1;
# #
create table t1 (id int, dt datetime); create table t1 (id int, dt datetime);
insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"); insert into t1 values (1,"2001-08-14 00:00:00"),(2,"2001-08-15 00:00:00"),(3,"2001-08-16 00:00:00"),(4,"2003-09-15 01:20:30");
select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15'); select * from t1 where dt='2001-08-14 00:00:00' and dt = if(id=1,'2001-08-14 00:00:00','1999-08-15');
create index dt on t1 (dt);
select * from t1 where dt > 20021020;
select * from t1 ignore index (dt) where dt > 20021020;
drop table t1; drop table t1;
# #
......
...@@ -46,7 +46,7 @@ longlong Item_func_not::val_int() ...@@ -46,7 +46,7 @@ longlong Item_func_not::val_int()
static bool convert_constant_item(Field *field, Item **item) static bool convert_constant_item(Field *field, Item **item)
{ {
if ((*item)->const_item() && (*item)->type() != Item::INT_ITEM) if ((*item)->const_item())
{ {
if (!(*item)->save_in_field(field, 1) && if (!(*item)->save_in_field(field, 1) &&
!((*item)->null_value)) !((*item)->null_value))
......
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