~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_in.result

add test for bug600088: multibyte comments not shown correctly in SHOW CREATE TABLE 

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
create table t1 (a int);
220
220
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
221
221
create temporary table t2 (a int, filler char(200), key(a)) engine=myisam;
222
 
insert into t2 select C.a*2,   'no'  from t1 A, t1 B, t1 C where A.a < 10;
 
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);
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    11      Using where
 
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');
271
271
2006-04-25 10:19:00     yes
272
272
drop table t2;
273
273
create table t2 (a varchar(10), filler char(200), key(a));
274
 
insert into t2 select 'foo', 'no' from t1 A, t1 B where A.a < 10;
275
 
insert into t2 select 'barbar', 'no' from t1 A, t1 B where A.a < 10;
276
 
insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B where A.a < 10;
 
274
insert into t2 select 'foo', 'no' from t1 A, t1 B;
 
275
insert into t2 select 'barbar', 'no' from t1 A, t1 B;
 
276
insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B;
277
277
insert into t2 values ('fon', '1'), ('fop','1'), ('barbaq','1'), 
278
278
('barbas','1'), ('bazbazbay', '1'),('zz','1');
279
279
explain select * from t2 where a not in('foo','barbar', 'bazbazbaz');
281
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
 
insert into t2 select 345.67890, 'no' from t1 A, t1 B where A.a < 10;
285
 
insert into t2 select 43245.34, 'no' from t1 A, t1 B where A.a < 10;
286
 
insert into t2 select 64224.56344, 'no' from t1 A, t1 B where A.a < 10;
 
284
insert into t2 select 345.67890, 'no' from t1 A, t1 B;
 
285
insert into t2 select 43245.34, 'no' from t1 A, t1 B;
 
286
insert into t2 select 64224.56344, 'no' from t1 A, t1 B;
287
287
insert into t2 values (0, '1'), (22334.123,'1'), (33333,'1'), 
288
288
(55555,'1'), (77777, '1');
289
289
explain
304
304
set @str="update t2 set b=1 where a not in (";
305
305
select count(*) from (
306
306
select @str:=concat(@str, @cnt:=@cnt+1, ",") 
307
 
from t1 A, t1 B, t1 C, t1 D  where A.a < 10) Z;
 
307
from t1 A, t1 B, t1 C, t1 D) Z;
308
308
count(*)
309
309
10000
310
310
set @str:=concat(@str, "10000)");
349
349
JOIN t2 ON t3.a=t2.a
350
350
JOIN t4 WHERE t4.a IN (t1.b, t2.b);
351
351
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
352
1       SIMPLE  t3      index   PRIMARY PRIMARY 4       NULL    4       Using index
352
353
1       SIMPLE  t1      eq_ref  PRIMARY PRIMARY 4       test.t3.a       1       
353
354
1       SIMPLE  t2      ALL     PRIMARY NULL    NULL    NULL    5       Using where; Using join buffer
354
 
1       SIMPLE  t3      index   PRIMARY PRIMARY 4       NULL    4       Using index
355
355
1       SIMPLE  t4      ALL     PRIMARY NULL    NULL    NULL    7       Range checked for each record (index map: 0x1)
356
356
SELECT STRAIGHT_JOIN * FROM t3 
357
357
JOIN t1 ON t3.a=t1.a 
367
367
FROM t3, t1, t2
368
368
WHERE t3.a=t1.a AND t3.a=t2.a;
369
369
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
370
1       PRIMARY t3      index   PRIMARY PRIMARY 4       NULL    4       Using index
370
371
1       PRIMARY t1      eq_ref  PRIMARY PRIMARY 4       test.t3.a       1       
371
372
1       PRIMARY t2      ALL     PRIMARY NULL    NULL    NULL    5       Using where; Using join buffer
372
 
1       PRIMARY t3      index   PRIMARY PRIMARY 4       NULL    4       Using index
373
373
2       DEPENDENT SUBQUERY      t4      index   NULL    PRIMARY 4       NULL    7       Using where; Using index
374
374
SELECT STRAIGHT_JOIN 
375
375
(SELECT SUM(t4.a) FROM t4 WHERE t4.a IN (t1.b, t2.b)) 
385
385
a
386
386
SELECT * FROM t1 WHERE a IN (-1, -2);
387
387
a
388
 
CREATE TABLE t2 (a BIGINT UNSIGNED);
 
388
CREATE TABLE t2 (a BIGINT);
389
389
insert into t2 values(13491727406643098568),
390
390
(0x0fffffefffffffff),
391
391
(0x0ffffffeffffffff),
457
457
CREATE TABLE t1 (id int not null);
458
458
INSERT INTO t1 VALUES (1),(2);
459
459
SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) );
460
 
ERROR 22012: Division by 0
 
460
id
 
461
Warnings:
 
462
Error   1365    Division by 0
461
463
DROP TABLE t1;
462
464
End of 5.0 tests
463
465
create TEMPORARY table t1(f1 char(1)) ENGINE=MYISAM;