~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/subselect.result

  • Committer: Jay Pipes
  • Date: 2009-03-01 03:08:20 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: jpipes@serialcoder-20090301030820-8kxgypvo3yexa9d1
Final removal of timezones

Show diffs side-by-side

added added

removed removed

Lines of Context:
336
336
INSERT INTO t3 VALUES ('W','a'),('A','c'),('J','b');
337
337
CREATE TABLE t2 (a varchar(20),b int NOT NULL default '0') ENGINE=MyISAM;
338
338
INSERT INTO t2 VALUES ('W','1'),('A','3'),('J','2');
339
 
CREATE TABLE t1 (a varchar(20),b date NOT NULL default '0000-00-00') ENGINE=MyISAM;
 
339
CREATE TABLE t1 (a varchar(20),b date NULL) ENGINE=MyISAM;
340
340
INSERT INTO t1 VALUES ('W','1732-02-22'),('A','1735-10-30'),('J','1743-04-13');
341
341
SELECT * FROM t1 WHERE b = (SELECT MIN(b) FROM t1);
342
342
a       b
378
378
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
379
379
CREATE TABLE `t1` (
380
380
`topic` bigint NOT NULL default '0',
381
 
`date` date NOT NULL default '0000-00-00',
 
381
`date` date NULL,
382
382
`pseudo` varchar(35) NOT NULL default '',
383
383
PRIMARY KEY  (`pseudo`,`date`,`topic`),
384
384
KEY `topic` (`topic`)
428
428
CREATE TABLE `t2` (
429
429
`mot` varchar(30) NOT NULL default '',
430
430
`topic` bigint NOT NULL default '0',
431
 
`date` date NOT NULL default '0000-00-00',
 
431
`date` date NULL,
432
432
`pseudo` varchar(35) NOT NULL default '',
433
433
PRIMARY KEY  (`mot`,`pseudo`,`date`,`topic`)
434
434
) ENGINE=MyISAM ROW_FORMAT=DYNAMIC;
921
921
CREATE TABLE `t1` (
922
922
`mot` varchar(30) NOT NULL default '',
923
923
`topic` bigint NOT NULL default '0',
924
 
`date` date NOT NULL default '0000-00-00',
 
924
`date` date NULL DEFAULT '2009-01-20',
925
925
`pseudo` varchar(35) NOT NULL default '',
926
926
PRIMARY KEY  (`mot`,`pseudo`,`date`,`topic`),
927
927
KEY `pseudo` (`pseudo`,`date`,`topic`),
930
930
CREATE TABLE `t2` (
931
931
`mot` varchar(30) NOT NULL default '',
932
932
`topic` bigint NOT NULL default '0',
933
 
`date` date NOT NULL default '0000-00-00',
 
933
`date` date NULL default '1997-08-29',
934
934
`pseudo` varchar(35) NOT NULL default '',
935
935
PRIMARY KEY  (`mot`,`pseudo`,`date`,`topic`),
936
936
KEY `pseudo` (`pseudo`,`date`,`topic`),
951
951
2
952
952
select * from t1;
953
953
mot     topic   date    pseudo
954
 
joce    1       0000-00-00      joce
955
 
test    2       0000-00-00      test
 
954
joce    1       2009-01-20      joce
 
955
test    2       2009-01-20      test
956
956
DELETE FROM t1 WHERE topic IN (SELECT DISTINCT topic FROM t2 WHERE NOT
957
957
EXISTS(SELECT * FROM t3 WHERE numeropost=topic));
958
958
select * from t1;
959
959
mot     topic   date    pseudo
960
 
joce    1       0000-00-00      joce
 
960
joce    1       2009-01-20      joce
961
961
drop table t1, t2, t3;
962
962
SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
963
963
a       (SELECT a)
966
966
SHOW CREATE TABLE t1;
967
967
Table   Create Table
968
968
t1      CREATE TABLE `t1` (
969
 
  `a` int NOT NULL,
970
 
  `(SELECT 1)` int NOT NULL
 
969
  `a` int NOT NULL DEFAULT '0',
 
970
  `(SELECT 1)` int NOT NULL DEFAULT '0'
971
971
) ENGINE=MyISAM
972
972
drop table t1;
973
973
CREATE TABLE t1 ENGINE=MyISAM SELECT * FROM (SELECT 1 as a,(SELECT a)) a;
974
974
SHOW CREATE TABLE t1;
975
975
Table   Create Table
976
976
t1      CREATE TABLE `t1` (
977
 
  `a` int NOT NULL,
978
 
  `(SELECT a)` int NOT NULL
 
977
  `a` int NOT NULL DEFAULT '0',
 
978
  `(SELECT a)` int NOT NULL DEFAULT '0'
979
979
) ENGINE=MyISAM
980
980
drop table t1;
981
981
CREATE TABLE t1 ENGINE=MyISAM SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a;
982
982
SHOW CREATE TABLE t1;
983
983
Table   Create Table
984
984
t1      CREATE TABLE `t1` (
985
 
  `a` int NOT NULL,
986
 
  `(SELECT a+0)` int NOT NULL
 
985
  `a` int NOT NULL DEFAULT '0',
 
986
  `(SELECT a+0)` int NOT NULL DEFAULT '0'
987
987
) ENGINE=MyISAM
988
988
drop table t1;
989
989
CREATE TABLE t1 ENGINE=MyISAM SELECT (SELECT 1 as a UNION SELECT 1+1 limit 1,1) as a;
1440
1440
Warnings:
1441
1441
Note    1003    select `test`.`t3`.`a` AS `a` from `test`.`t3` where <not>((`test`.`t3`.`a` <= <max>(select max(`test`.`t2`.`b`) AS `max(b)` from `test`.`t2` group by `test`.`t2`.`a`)))
1442
1442
drop table t2, t3;
1443
 
CREATE TABLE `t1` ( `id` bigint NOT NULL auto_increment, `taskid` bigint NOT NULL default '0', `dbid` int NOT NULL default '0', `create_date` datetime NOT NULL default '0000-00-00 00:00:00', `last_update` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY  (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ;
 
1443
CREATE TABLE `t1` ( `id` bigint NOT NULL auto_increment, `taskid` bigint NOT NULL default '0', `dbid` int NOT NULL default '0', `create_date` datetime, `last_update` datetime, PRIMARY KEY  (`id`)) ENGINE=MyISAM AUTO_INCREMENT=3 ;
1444
1444
INSERT INTO `t1` (`id`, `taskid`, `dbid`, `create_date`,`last_update`) VALUES (1, 1, 15, '2003-09-29 10:31:36', '2003-09-29 10:31:36'), (2, 1, 21, now(), now());
1445
1445
CREATE TABLE `t2` (`db_id` int NOT NULL auto_increment,`name` varchar(200) NOT NULL default '',`primary_uid` int NOT NULL default '0',`secondary_uid` int NOT NULL default '0',PRIMARY KEY  (`db_id`),UNIQUE KEY `name_2` (`name`)) ENGINE=MyISAM AUTO_INCREMENT=2147483647;
1446
1446
INSERT INTO `t2` (`db_id`, `name`, `primary_uid`, `secondary_uid`) VALUES (18, 'Not Set 1', 0, 0),(19, 'Valid', 1, 2),(20, 'Valid 2', 1, 2),(21, 'Should Not Return', 1, 2),(26, 'Not Set 2', 0, 0),(-1, 'ALL DB\'S', 0, 0);
2724
2724
SHOW CREATE TABLE t2;
2725
2725
Table   Create Table
2726
2726
t2      CREATE TABLE `t2` (
2727
 
  `sub_a` datetime
 
2727
  `sub_a` datetime DEFAULT NULL
2728
2728
) ENGINE=MyISAM
2729
2729
CREATE TABLE t3 ENGINE=MyISAM AS (SELECT a FROM t1 WHERE a < '2000-01-01') UNION (SELECT a FROM t1 WHERE a > '2000-01-01');
2730
2730
SHOW CREATE TABLE t3;
2731
2731
Table   Create Table
2732
2732
t3      CREATE TABLE `t3` (
2733
 
  `a` datetime
 
2733
  `a` datetime DEFAULT NULL
2734
2734
) ENGINE=MyISAM
2735
2735
DROP TABLE t1,t2,t3;
2736
2736
CREATE TABLE t1 (a int) ENGINE=MyISAM;
3175
3175
CREATE TABLE t1 (
3176
3176
i1 int NOT NULL default '0',
3177
3177
i2 int NOT NULL default '0',
3178
 
t datetime NOT NULL default '0000-00-00 00:00:00',
 
3178
t datetime,
3179
3179
PRIMARY KEY  (i1,i2,t))
3180
3180
ENGINE=MyISAM;
3181
3181
INSERT INTO t1 VALUES 
4027
4027
drop table t_in;
4028
4028
CREATE TABLE t1 (s1 char(1)) ENGINE=MyISAM;
4029
4029
INSERT INTO t1 VALUES ('a');
4030
 
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
 
4030
SELECT * FROM t1 WHERE 'a' = ANY (SELECT s1 FROM t1);
4031
4031
s1
4032
4032
a
4033
4033
DROP TABLE t1;