~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

Viewing changes to tests/r/func_in.result

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
44
217
217
46
218
218
DROP TABLE t1;
219
 
create table t1 (a int) ENGINE=MYISAM;
 
219
create table t1 (a int);
220
220
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
221
 
create table t2 (a int, filler char(200), key(a)) ENGINE=MYISAM;
 
221
create temporary table t2 (a int, filler char(200), key(a)) engine=myisam;
222
222
insert into t2 select C.a*2,   'no'  from t1 A, t1 B, t1 C;
223
223
insert into t2 select C.a*2+1, 'yes' from t1 C;
224
224
explain 
225
225
select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
226
226
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
227
 
1       SIMPLE  t2      range   a       a       5       NULL    12      Using where; Using MRR
 
227
1       SIMPLE  t2      range   a       a       5       NULL    12      Using where
228
228
select * from t2 where a NOT IN (0, 2,4,6,8,10,12,14,16,18);
229
229
a       filler
230
230
1       yes
239
239
19      yes
240
240
explain select * from t2 force index(a) where a NOT IN (2,2,2,2,2,2);
241
241
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
242
 
1       SIMPLE  t2      range   a       a       5       NULL    912     Using where; Using MRR
 
242
1       SIMPLE  t2      range   a       a       5       NULL    912     Using where
243
243
explain select * from t2 force index(a) where a <> 2;
244
244
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
245
 
1       SIMPLE  t2      range   a       a       5       NULL    912     Using where; Using MRR
 
245
1       SIMPLE  t2      range   a       a       5       NULL    912     Using where
246
246
drop table t2;
247
247
create table t2 (a datetime, filler char(200), key(a));
248
248
insert into t2 select '2006-04-25 10:00:00' + interval C.a minute,
254
254
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00', 
255
255
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
256
256
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
257
 
1       SIMPLE  t2      range   a       a       9       NULL    20      Using where; Using MRR
 
257
1       SIMPLE  t2      range   a       a       9       NULL    20      Using where
258
258
select * from t2 where a NOT IN (
259
259
'2006-04-25 10:00:00','2006-04-25 10:02:00','2006-04-25 10:04:00', 
260
260
'2006-04-25 10:06:00', '2006-04-25 10:08:00');
278
278
('barbas','1'), ('bazbazbay', '1'),('zz','1');
279
279
explain select * from t2 where a not in('foo','barbar', 'bazbazbaz');
280
280
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
281
 
1       SIMPLE  t2      range   a       a       43      NULL    5       Using where; Using MRR
 
281
1       SIMPLE  t2      range   a       a       43      NULL    5       Using where
282
282
drop table t2;
283
283
create table t2 (a decimal(10,5), filler char(200), key(a));
284
284
insert into t2 select 345.67890, 'no' from t1 A, t1 B;
289
289
explain
290
290
select * from t2 where a not in (345.67890, 43245.34, 64224.56344);
291
291
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
292
 
1       SIMPLE  t2      range   a       a       7       NULL    4       Using where; Using MRR
 
292
1       SIMPLE  t2      range   a       a       7       NULL    4       Using where
293
293
select * from t2 where a not in (345.67890, 43245.34, 64224.56344);
294
294
a       filler
295
295
0.00000 1
463
463
Error   1365    Division by 0
464
464
DROP TABLE t1;
465
465
End of 5.0 tests
466
 
create table t1(f1 char(1)) ENGINE=MYISAM;
 
466
create TEMPORARY table t1(f1 char(1)) ENGINE=MYISAM;
467
467
insert into t1 values ('a'),('b'),('1');
468
468
select f1 from t1 where f1 in ('a',1);
469
469
f1
495
495
explain select f1 from t1 where f1 in (2,1);
496
496
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
497
497
1       SIMPLE  t1      index   t1f1_idx        t1f1_idx        7       NULL    3       Using where; Using index
498
 
create table t2(f2 int, index t2f2(f2)) ENGINE=MYISAM;
 
498
create TEMPORARY table t2(f2 int, index t2f2(f2)) ENGINE=MYISAM;
499
499
insert into t2 values(0),(1),(2);
500
500
select f2 from t2 where f2 in ('a',2);
501
501
f2