~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_in.test

  • Committer: Brian Aker
  • Date: 2009-08-17 01:44:23 UTC
  • mto: This revision was merged to the branch mainline in revision 1118.
  • Revision ID: brian@gaz-20090817014423-jxi2qonsumm8mndf
Remove SQL level reference for DELAY (just now done correctly by default in
engine).

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); 
143
143
create temporary table t2 (a int, filler char(200), key(a)) engine=myisam;
144
144
 
145
 
insert into t2 select C.a*2,   'no'  from t1 A, t1 B, t1 C where A.a < 10;
 
145
insert into t2 select C.a*2,   'no'  from t1 A, t1 B, t1 C;
146
146
insert into t2 select C.a*2+1, 'yes' from t1 C;
147
147
 
148
148
explain 
180
180
#
181
181
create table t2 (a varchar(10), filler char(200), key(a));
182
182
 
183
 
insert into t2 select 'foo', 'no' from t1 A, t1 B where A.a < 10;
184
 
insert into t2 select 'barbar', 'no' from t1 A, t1 B where A.a < 10;
185
 
insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B where A.a < 10;
 
183
insert into t2 select 'foo', 'no' from t1 A, t1 B;
 
184
insert into t2 select 'barbar', 'no' from t1 A, t1 B;
 
185
insert into t2 select 'bazbazbaz', 'no' from t1 A, t1 B;
186
186
 
187
187
insert into t2 values ('fon', '1'), ('fop','1'), ('barbaq','1'), 
188
188
  ('barbas','1'), ('bazbazbay', '1'),('zz','1');
196
196
#
197
197
create table t2 (a decimal(10,5), filler char(200), key(a));
198
198
 
199
 
insert into t2 select 345.67890, 'no' from t1 A, t1 B where A.a < 10;
200
 
insert into t2 select 43245.34, 'no' from t1 A, t1 B where A.a < 10;
201
 
insert into t2 select 64224.56344, 'no' from t1 A, t1 B where A.a < 10;
 
199
insert into t2 select 345.67890, 'no' from t1 A, t1 B;
 
200
insert into t2 select 43245.34, 'no' from t1 A, t1 B;
 
201
insert into t2 select 64224.56344, 'no' from t1 A, t1 B;
202
202
 
203
203
insert into t2 values (0, '1'), (22334.123,'1'), (33333,'1'), 
204
204
  (55555,'1'), (77777, '1');
217
217
set @str="update t2 set b=1 where a not in (";
218
218
select count(*) from (
219
219
  select @str:=concat(@str, @cnt:=@cnt+1, ",") 
220
 
  from t1 A, t1 B, t1 C, t1 D  where A.a < 10) Z;
 
220
  from t1 A, t1 B, t1 C, t1 D) Z;
221
221
 
222
222
set @str:=concat(@str, "10000)");
223
223
select substr(@str, 1, 50);
262
262
INSERT INTO t4 VALUES (1,1),(2,2),(1000,1000),(1001,1001),(1002,1002),
263
263
       (1003,1003),(1004,1004);
264
264
 
265
 
--sorted_result
266
265
EXPLAIN SELECT STRAIGHT_JOIN * FROM t3 
267
266
  JOIN t1 ON t3.a=t1.a 
268
267
  JOIN t2 ON t3.a=t2.a
273
272
  JOIN t2 ON t3.a=t2.a
274
273
  JOIN t4 WHERE t4.a IN (t1.b, t2.b);
275
274
 
276
 
--sorted_result
277
275
EXPLAIN SELECT STRAIGHT_JOIN 
278
276
   (SELECT SUM(t4.a) FROM t4 WHERE t4.a IN (t1.b, t2.b)) 
279
277
  FROM t3, t1, t2
295
293
SELECT * FROM t1 WHERE a=-1 OR a=-2 ;
296
294
SELECT * FROM t1 WHERE a IN (-1, -2);
297
295
 
298
 
CREATE TABLE t2 (a BIGINT UNSIGNED);
 
296
CREATE TABLE t2 (a BIGINT);
299
297
insert into t2 values(13491727406643098568),
300
298
       (0x0fffffefffffffff),
301
299
       (0x0ffffffeffffffff),
362
360
CREATE TABLE t1 (id int not null);
363
361
INSERT INTO t1 VALUES (1),(2);
364
362
 
365
 
--error ER_DIVISION_BY_ZERO
366
363
SELECT id FROM t1 WHERE id IN(4564, (SELECT IF(1=0,1,1/0)) );
367
364
 
368
365
DROP TABLE t1;