139
139
# BUG#15872: Excessive memory consumption of range analysis of NOT IN
140
create table t1 (a int) ENGINE=MYISAM;
140
# I have disabled the EXPLAIN because we must use Innodb with this test.
141
create table t1 (a int);
141
142
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
142
create table t2 (a int, filler char(200), key(a)) ENGINE=MYISAM;
143
create table t2 (a int, filler char(200), key(a));
144
145
insert into t2 select C.a*2, 'no' from t1 A, t1 B, t1 C;
145
146
insert into t2 select C.a*2+1, 'yes' from t1 C;
148
select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
148
# FIXME -> Needs to work with Innodb
150
# select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
149
151
select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
151
explain select * from t2 force index(a) where a NOT IN (2,2,2,2,2,2);
152
explain select * from t2 force index(a) where a <> 2;
154
# explain select * from t2 force index(a) where a NOT IN (2,2,2,2,2,2);
155
# explain select * from t2 force index(a) where a <> 2;
369
372
# Bug#18360: Type aggregation for IN and CASE may lead to a wrong result
371
create table t1(f1 char(1)) ENGINE=MYISAM;
374
create TEMPORARY table t1(f1 char(1)) ENGINE=MYISAM;
372
375
insert into t1 values ('a'),('b'),('1');
373
376
select f1 from t1 where f1 in ('a',1);
374
377
select f1, case f1 when 'a' then '+' when 1 then '-' end from t1;
379
382
explain select f1 from t1 where f1 in ('a','b');
380
383
select f1 from t1 where f1 in (2,1);
381
384
explain select f1 from t1 where f1 in (2,1);
382
create table t2(f2 int, index t2f2(f2)) ENGINE=MYISAM;
385
create TEMPORARY table t2(f2 int, index t2f2(f2)) ENGINE=MYISAM;
383
386
insert into t2 values(0),(1),(2);
384
387
select f2 from t2 where f2 in ('a',2);
385
388
explain select f2 from t2 where f2 in ('a',2);