~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/r/subselect.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
393
393
('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
394
394
EXPLAIN EXTENDED SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
395
395
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
396
 
1       SIMPLE  t1      index   NULL    PRIMARY 153     NULL    2       100.00  Using where; Using index
 
396
1       SIMPLE  t1      index   NULL    PRIMARY 154     NULL    2       100.00  Using where; Using index
397
397
Warnings:
398
398
Note    1003    select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')
399
399
EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
400
400
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
401
401
1       PRIMARY NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    No tables used
402
 
2       SUBQUERY        t1      index   NULL    PRIMARY 153     NULL    2       100.00  Using where; Using index
 
402
2       SUBQUERY        t1      index   NULL    PRIMARY 154     NULL    2       100.00  Using where; Using index
403
403
Warnings:
404
404
Note    1003    select (select distinct `test`.`t1`.`date` AS `date` from `test`.`t1` where (`test`.`t1`.`date` = '2002-08-03')) AS `(SELECT DISTINCT date FROM t1 WHERE date='2002-08-03')`
405
405
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
704
704
1
705
705
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1);
706
706
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
707
 
1       PRIMARY t2      ref     id      id      5       const   1       100.00  Using index
 
707
1       PRIMARY t2      ref     id      id      5       const   1       100.00  Using where; Using index
708
708
Warnings:
709
709
Note    1249    Select 2 was reduced during optimization
710
710
Note    1003    select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = 1)
716
716
2
717
717
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1+(select 1));
718
718
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
719
 
1       PRIMARY t2      ref     id      id      5       const   1       100.00  Using index
 
719
1       PRIMARY t2      ref     id      id      5       const   1       100.00  Using where; Using index
720
720
Warnings:
721
721
Note    1249    Select 3 was reduced during optimization
722
722
Note    1249    Select 2 was reduced during optimization
892
892
explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
893
893
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
894
894
1       PRIMARY t1      index   NULL    PRIMARY 4       NULL    4       100.00  Using index
895
 
2       DEPENDENT SUBQUERY      t2      ref_or_null     a       a       5       func    2       100.00  Using index
 
895
2       DEPENDENT SUBQUERY      t2      ref_or_null     a       a       5       func    2       100.00  Using where; Using index
896
896
2       DEPENDENT SUBQUERY      t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where; Using join buffer
897
897
Warnings:
898
898
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`
991
991
SHOW CREATE TABLE t1;
992
992
Table   Create Table
993
993
t1      CREATE TEMPORARY TABLE `t1` (
994
 
  `a` int NOT NULL DEFAULT '0',
995
 
  `(SELECT 1)` int NOT NULL DEFAULT '0'
996
 
) ENGINE=MyISAM
 
994
  `a` INT NOT NULL DEFAULT '0',
 
995
  `(SELECT 1)` INT NOT NULL DEFAULT '0'
 
996
) ENGINE=MyISAM COLLATE = utf8_general_ci
997
997
drop table t1;
998
998
CREATE TEMPORARY TABLE t1 ENGINE=MyISAM SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
999
999
SHOW CREATE TABLE t1;
1000
1000
Table   Create Table
1001
1001
t1      CREATE TEMPORARY TABLE `t1` (
1002
 
  `a` int NOT NULL DEFAULT '0',
1003
 
  `(SELECT a)` int NOT NULL DEFAULT '0'
1004
 
) ENGINE=MyISAM
 
1002
  `a` INT NOT NULL DEFAULT '0',
 
1003
  `(SELECT a)` INT NOT NULL DEFAULT '0'
 
1004
) ENGINE=MyISAM COLLATE = utf8_general_ci
1005
1005
drop table t1;
1006
1006
CREATE TEMPORARY TABLE t1 ENGINE=MyISAM SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a;
1007
1007
SHOW CREATE TABLE t1;
1008
1008
Table   Create Table
1009
1009
t1      CREATE TEMPORARY TABLE `t1` (
1010
 
  `a` int NOT NULL DEFAULT '0',
1011
 
  `(SELECT a+0)` int NOT NULL DEFAULT '0'
1012
 
) ENGINE=MyISAM
 
1010
  `a` INT NOT NULL DEFAULT '0',
 
1011
  `(SELECT a+0)` INT NOT NULL DEFAULT '0'
 
1012
) ENGINE=MyISAM COLLATE = utf8_general_ci
1013
1013
drop table t1;
1014
1014
CREATE TEMPORARY TABLE t1 ENGINE=MyISAM SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
1015
1015
select * from t1;
1018
1018
SHOW CREATE TABLE t1;
1019
1019
Table   Create Table
1020
1020
t1      CREATE TEMPORARY TABLE `t1` (
1021
 
  `a` bigint NOT NULL
1022
 
) ENGINE=MyISAM
 
1021
  `a` BIGINT NOT NULL
 
1022
) ENGINE=MyISAM COLLATE = utf8_general_ci
1023
1023
drop table t1;
1024
1024
create table t1 (a int);
1025
1025
insert into t1 values (1), (2), (3);
1434
1434
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
1435
1435
2       SUBQUERY        t2      system  NULL    NULL    NULL    NULL    0       0.00    const row not found
1436
1436
Warnings:
1437
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max('0') from `test`.`t2`)))
 
1437
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < (select max(NULL) from `test`.`t2`)))
1438
1438
select * from t3 where a >= some (select b from t2);
1439
1439
a
1440
1440
explain extended select * from t3 where a >= some (select b from t2);
1442
1442
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
1443
1443
2       SUBQUERY        t2      system  NULL    NULL    NULL    NULL    0       0.00    const row not found
1444
1444
Warnings:
1445
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min('0') from `test`.`t2`)))
 
1445
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= (select min(NULL) from `test`.`t2`)))
1446
1446
select * from t3 where a >= all (select b from t2 group by 1);
1447
1447
a
1448
1448
6
1453
1453
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
1454
1454
2       SUBQUERY        t2      system  NULL    NULL    NULL    NULL    0       0.00    const row not found
1455
1455
Warnings:
1456
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select '0' AS `b` from `test`.`t2` group by 1)))
 
1456
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` < <max>(select NULL AS `b` from `test`.`t2` group by 1)))
1457
1457
select * from t3 where a >= some (select b from t2 group by 1);
1458
1458
a
1459
1459
explain extended select * from t3 where a >= some (select b from t2 group by 1);
1461
1461
1       PRIMARY t3      ALL     NULL    NULL    NULL    NULL    3       100.00  Using where
1462
1462
2       SUBQUERY        t2      system  NULL    NULL    NULL    NULL    0       0.00    const row not found
1463
1463
Warnings:
1464
 
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select '0' AS `b` from `test`.`t2` group by 1)))
 
1464
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <nop>((`test`.`t3`.`a` >= <min>(select NULL AS `b` from `test`.`t2` group by 1)))
1465
1465
select * from t3 where NULL >= any (select b from t2);
1466
1466
a
1467
1467
explain extended select * from t3 where NULL >= any (select b from t2);
2966
2966
SHOW CREATE TABLE t2;
2967
2967
Table   Create Table
2968
2968
t2      CREATE TEMPORARY TABLE `t2` (
2969
 
  `sub_a` datetime DEFAULT NULL
2970
 
) ENGINE=MyISAM
 
2969
  `sub_a` DATETIME DEFAULT NULL
 
2970
) ENGINE=MyISAM COLLATE = utf8_general_ci
2971
2971
CREATE TEMPORARY TABLE t3 ENGINE=MyISAM AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01');
2972
2972
SHOW CREATE TABLE t3;
2973
2973
Table   Create Table
2974
2974
t3      CREATE TEMPORARY TABLE `t3` (
2975
 
  `a` datetime DEFAULT NULL
2976
 
) ENGINE=MyISAM
 
2975
  `a` DATETIME DEFAULT NULL
 
2976
) ENGINE=MyISAM COLLATE = utf8_general_ci
2977
2977
DROP TABLE t1,t2,t3;
2978
2978
#
2979
2979
# Bug 24653: sorting by expressions containing subselects
3964
3964
a varchar(255) default NULL,
3965
3965
b timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
3966
3966
INDEX idx(a,b));
3967
 
Warnings:
3968
 
Warning 1071    Specified key was too long; max key length is 767 bytes
3969
3967
CREATE TABLE t2 (
3970
3968
a varchar(255) default NULL);
3971
3969
INSERT INTO t1 VALUES ('abcdefghijk','2007-05-07 06:00:24');
4528
4526
SELECT * FROM t1 JOIN  (t1 t1a)  ON 1;
4529
4527
a       a
4530
4528
1       1
 
4529
1       2
4531
4530
2       1
4532
 
1       2
4533
4531
2       2
4534
4532
SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
4535
4533
a       a