~vkolesnikov/pbxt/pbxt-preload-test-bug

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/r/subselect.result

  • Committer: paul-mccullagh
  • Date: 2008-03-10 11:36:34 UTC
  • Revision ID: paul-mccullagh-417ebf175a9c8ee6e5b3777d9e2398e1fb197391
Implemented full durability

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
3       DEPENDENT SUBQUERY      NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
49
49
2       DERIVED NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
50
50
Warnings:
51
 
Note    1276    Field or reference 'a' of SELECT #3 was resolved in SELECT #1
52
 
Note    1276    Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
53
 
Note    1003    select 1 AS `1` from (select 1 AS `a`) `b` having ((select `b`.`a` AS `a`) = 1)
 
51
Note    1276    Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
 
52
Note    1276    Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
 
53
Note    1003    select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1)
54
54
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
55
55
1
56
56
1
204
204
3       DERIVED t2      ALL     NULL    NULL    NULL    NULL    2       100.00  Using where
205
205
2       SUBQUERY        t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where; Using filesort
206
206
Warnings:
207
 
Note    1003    select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,`tt`.`a` AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
 
207
Note    1003    select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
208
208
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
209
209
a
210
210
2
224
224
2       DEPENDENT SUBQUERY      t2      ALL     NULL    NULL    NULL    NULL    2       100.00  
225
225
3       DEPENDENT SUBQUERY      t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
226
226
Warnings:
227
 
Note    1276    Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1
 
227
Note    1276    Field or reference 'test.t4.a' of SELECT #3 was resolved in SELECT #1
228
228
Note    1003    select `test`.`t4`.`b` AS `b`,(select avg((`test`.`t2`.`a` + (select min(`test`.`t3`.`a`) AS `min(t3.a)` from `test`.`t3` where (`test`.`t3`.`a` >= `test`.`t4`.`a`)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from `test`.`t2`) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from `test`.`t4`
229
229
select * from t3 where exists (select * from t2 where t2.b=t3.a);
230
230
a
313
313
3       DEPENDENT UNION t5      ALL     NULL    NULL    NULL    NULL    2       100.00  Using where
314
314
NULL    UNION RESULT    <union2,3>      ALL     NULL    NULL    NULL    NULL    NULL    NULL    
315
315
Warnings:
316
 
Note    1276    Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1
317
 
Note    1276    Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1
 
316
Note    1276    Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
 
317
Note    1276    Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
318
318
Note    1003    select (select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
319
319
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
320
320
ERROR 21000: Subquery returns more than 1 row
332
332
1       PRIMARY t6      ALL     NULL    NULL    NULL    NULL    4       100.00  Using where
333
333
2       DEPENDENT SUBQUERY      t7      eq_ref  PRIMARY PRIMARY 4       test.t6.clinic_uq       1       100.00  Using index
334
334
Warnings:
335
 
Note    1276    Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
 
335
Note    1276    Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
336
336
Note    1003    select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where exists(select 1 AS `Not_used` from `test`.`t7` where (`test`.`t7`.`uq` = `test`.`t6`.`clinic_uq`))
337
337
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
338
338
ERROR 23000: Column 'a' in field list is ambiguous
368
368
2       SUBQUERY        t8      const   PRIMARY PRIMARY 37      const   1       100.00  
369
369
3       SUBQUERY        t8      const   PRIMARY PRIMARY 37              1       100.00  Using index
370
370
Warnings:
371
 
Note    1003    select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
 
371
Note    1003    select 'joce' AS `pseudo`,(select 'test' AS `email` from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where 1
372
372
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
373
373
t8 WHERE pseudo='joce');
374
374
ERROR 21000: Operand should contain 1 column(s)
394
394
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
395
395
1       SIMPLE  t1      index   NULL    PRIMARY 43      NULL    2       100.00  Using where; Using index
396
396
Warnings:
397
 
Note    1003    select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = 20020803)
 
397
Note    1003    select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = _latin1'2002-08-03')
398
398
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
399
399
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
400
400
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
401
401
2       SUBQUERY        t1      index   NULL    PRIMARY 43      NULL    2       100.00  Using where; Using index
402
402
Warnings:
403
 
Note    1003    select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = 20020803)) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
 
403
Note    1003    select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = _latin1'2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
404
404
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
405
405
date
406
406
2002-08-03
421
421
3       UNION   NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
422
422
NULL    UNION RESULT    <union2,3>      ALL     NULL    NULL    NULL    NULL    NULL    NULL    
423
423
Warnings:
424
 
Note    1003    select 1 AS `1` from `test`.`t1`
 
424
Note    1003    select 1 AS `1` from `test`.`t1` where 1
425
425
drop table t1;
426
426
CREATE TABLE `t1` (
427
427
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
547
547
1       PRIMARY t1      const   PRIMARY,numreponse      PRIMARY 7       const,const     1       100.00  Using index
548
548
2       SUBQUERY        NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Select tables optimized away
549
549
Warnings:
550
 
Note    1003    select `test`.`t1`.`numreponse` AS `numreponse` from `test`.`t1` where ((`test`.`t1`.`numeropost` = _latin1'1'))
 
550
Note    1003    select '3' AS `numreponse` from `test`.`t1` where (('1' = _latin1'1'))
551
551
drop table t1;
552
552
CREATE TABLE t1 (a int(1));
553
553
INSERT INTO t1 VALUES (1);
868
868
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
869
869
1       PRIMARY t1      ALL     NULL    NULL    NULL    NULL    3       100.00  
870
870
Warnings:
871
 
Note    1276    Field or reference 'a' of SELECT #2 was resolved in SELECT #1
 
871
Note    1276    Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
872
872
Note    1249    Select 2 was reduced during optimization
873
873
Note    1003    select (`test`.`t1`.`a` + 1) AS `(select a+1)` from `test`.`t1`
874
874
select (select a+1) from t1;
905
905
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
906
906
1       PRIMARY t1      index   NULL    PRIMARY 4       NULL    4       100.00  Using index
907
907
2       DEPENDENT SUBQUERY      t2      ref_or_null     a       a       5       func    2       100.00  Using where; Using index
908
 
2       DEPENDENT SUBQUERY      t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
 
908
2       DEPENDENT SUBQUERY      t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where; Using join buffer
909
909
Warnings:
910
910
Note    1003    select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t2`.`a`) and ((<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`) or isnull(`test`.`t2`.`a`))) having <is_not_null_test>(`test`.`t2`.`a`))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
911
911
drop table t1,t2,t3;
1180
1180
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
1181
1181
2       DEPENDENT SUBQUERY      NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1182
1182
Warnings:
1183
 
Note    1003    select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)`
 
1183
Note    1003    select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
1184
1184
INSERT INTO t1 (pseudo) VALUES ('test1');
1185
1185
SELECT 0 IN (SELECT 1 FROM t1 a);
1186
1186
0 IN (SELECT 1 FROM t1 a)
1190
1190
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
1191
1191
2       DEPENDENT SUBQUERY      NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1192
1192
Warnings:
1193
 
Note    1003    select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a`)) AS `0 IN (SELECT 1 FROM t1 a)`
 
1193
Note    1003    select <in_optimizer>(0,<exists>(select 1 AS `Not_used` from `test`.`t1` `a` where 0)) AS `0 IN (SELECT 1 FROM t1 a)`
1194
1194
drop table t1;
1195
1195
CREATE TABLE `t1` (
1196
1196
`i` int(11) NOT NULL default '0',
1355
1355
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
1356
1356
1       PRIMARY t2      index   NULL    a       5       NULL    4       100.00  Using where; Using index
1357
1357
2       DEPENDENT SUBQUERY      t1      ref     a       a       5       func    1001    100.00  Using where; Using index
1358
 
2       DEPENDENT SUBQUERY      t3      index   a       a       5       NULL    3       100.00  Using where; Using index
 
1358
2       DEPENDENT SUBQUERY      t3      index   a       a       5       NULL    3       100.00  Using where; Using index; Using join buffer
1359
1359
Warnings:
1360
1360
Note    1003    select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t3`.`a` = `test`.`t1`.`b`) and (<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
1361
1361
insert into t1 values (3,31);
1532
1532
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1533
1533
2       SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL    0       0.00    
1534
1534
Warnings:
1535
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3`
 
1535
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
1536
1536
select * from t3 where NULL >= any (select b from t2 group by 1);
1537
1537
a
1538
1538
explain extended select * from t3 where NULL >= any (select b from t2 group by 1);
1540
1540
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1541
1541
2       SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL    0       0.00    Using temporary; Using filesort
1542
1542
Warnings:
1543
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3`
 
1543
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
1544
1544
select * from t3 where NULL >= some (select b from t2);
1545
1545
a
1546
1546
explain extended select * from t3 where NULL >= some (select b from t2);
1548
1548
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1549
1549
2       SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL    0       0.00    
1550
1550
Warnings:
1551
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3`
 
1551
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
1552
1552
select * from t3 where NULL >= some (select b from t2 group by 1);
1553
1553
a
1554
1554
explain extended select * from t3 where NULL >= some (select b from t2 group by 1);
1556
1556
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
1557
1557
2       SUBQUERY        t2      ALL     NULL    NULL    NULL    NULL    0       0.00    Using temporary; Using filesort
1558
1558
Warnings:
1559
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3`
 
1559
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where 0
1560
1560
insert into t2 values (2,2), (2,1), (3,3), (3,1);
1561
1561
select * from t3 where a > all (select max(b) from t2 group by a);
1562
1562
a
1618
1618
3       UNION   t1      ALL     NULL    NULL    NULL    NULL    1       100.00  
1619
1619
NULL    UNION RESULT    <union2,3>      ALL     NULL    NULL    NULL    NULL    NULL    NULL    
1620
1620
Warnings:
1621
 
Note    1003    select `test`.`t1`.`s1` AS `s1` from `test`.`t1`
 
1621
Note    1003    select `test`.`t1`.`s1` AS `s1` from `test`.`t1` where 1
1622
1622
drop table t1;
1623
1623
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
1624
1624
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
1743
1743
1       PRIMARY tt      ALL     NULL    NULL    NULL    NULL    12      100.00  Using where
1744
1744
2       DEPENDENT SUBQUERY      t1      eq_ref  PRIMARY PRIMARY 4       test.tt.id      1       100.00  Using where; Using index
1745
1745
Warnings:
1746
 
Note    1276    Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1
 
1746
Note    1276    Field or reference 'test.tt.id' of SELECT #2 was resolved in SELECT #1
1747
1747
Note    1003    select `test`.`tt`.`id` AS `id`,`test`.`tt`.`text` AS `text` from `test`.`t1` `tt` where (not(exists(select `test`.`t1`.`id` AS `id` from `test`.`t1` where ((`test`.`t1`.`id` < 8) and (`test`.`t1`.`id` = `test`.`tt`.`id`)) having (`test`.`t1`.`id` is not null))))
1748
1748
insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
1749
1749
create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
2279
2279
1       PRIMARY up      ALL     NULL    NULL    NULL    NULL    2       100.00  Using where
2280
2280
2       DEPENDENT SUBQUERY      t1      ALL     NULL    NULL    NULL    NULL    2       100.00  Using where
2281
2281
Warnings:
2282
 
Note    1276    Field or reference 'up.a' of SELECT #2 was resolved in SELECT #1
 
2282
Note    1276    Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
2283
2283
Note    1003    select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where exists(select 1 AS `Not_used` from `test`.`t1` where (`test`.`t1`.`a` = `test`.`up`.`a`))
2284
2284
drop table t1;
2285
2285
CREATE TABLE t1 (t1_a int);
2853
2853
3
2854
2854
4
2855
2855
DROP TABLE t1,t2,t3;
2856
 
purge master logs before (select adddate(current_timestamp(), interval -4 day));
2857
2856
CREATE TABLE t1 (f1 INT);
2858
2857
CREATE TABLE t2 (f2 INT);
2859
2858
INSERT INTO t1 VALUES (1);
3468
3467
ORDER BY t1.t DESC LIMIT 1);
3469
3468
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
3470
3469
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    1       
3471
 
1       PRIMARY t1      index   NULL    PRIMARY 16      NULL    11      Using where; Using index
 
3470
1       PRIMARY t1      index   NULL    PRIMARY 16      NULL    11      Using where; Using index; Using join buffer
3472
3471
2       DEPENDENT SUBQUERY      t1      ref     PRIMARY PRIMARY 8       test.t2.i1,const        2       Using where; Using index; Using filesort
3473
3472
SELECT * FROM t1,t2
3474
3473
WHERE t1.t = (SELECT t1.t FROM t1