~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/select.result

  • Committer: Brian Aker
  • Date: 2010-10-22 07:38:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1885.
  • Revision ID: brian@tangent.org-20101022073849-h3j2eglp70dav2ze
Adds in a portion of the ref constraints table.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1266
1266
58      company 8
1267
1267
65      company 9
1268
1268
68      company 10
1269
 
select * from t1 CROSS JOIN t1 t12;
 
1269
select * from t1,t1 t12;
1270
1270
Period  Varor_period    Period  Varor_period
1271
1271
9410    9412    9410    9412
1272
1272
select t2.fld1,t22.fld1 from t2,t2 t22 where t2.fld1 >= 250501 and t2.fld1 <= 250505 and t22.fld1 >= 250501 and t22.fld1 <= 250505;
1903
1903
select max(t2nr) from t3 where price=983543950;
1904
1904
max(t2nr)
1905
1905
41807
 
1906
select t1.period from t3 = t1 limit 1;
 
1907
period
 
1908
1001
1906
1909
select t1.period from t1 as t1 limit 1;
1907
1910
period
1908
1911
9410
2815
2818
insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'),
2816
2819
(4,'2005-10-01'),(5,'2005-12-30');
2817
2820
select * from t1 where f2 >= 0            order by f2;
2818
 
ERROR HY000: Received an invalid DATE value '0'.
 
2821
ERROR HY000: Received an invalid datetime value '0'.
2819
2822
select * from t1 where f2 >= '0000-00-00' order by f2;
2820
2823
ERROR HY000: Received an invalid datetime value '0000-00-00'.
2821
2824
select * from t1 where f2 >= '2005-09-31' order by f2;
2929
2932
create table t1 (a int);
2930
2933
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
2931
2934
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
2932
 
insert into t2 select A.a, B.a, C.a, C.a from t1 A CROSS JOIN t1 B CROSS JOIN t1 C;
 
2935
insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
2933
2936
analyze table t2;
2934
2937
Table   Op      Msg_type        Msg_text
2935
2938
test.t2 analyze status  OK
2990
2993
EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1;
2991
2994
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
2992
2995
1       SIMPLE  t1      const   PRIMARY PRIMARY 4       const   1       
2993
 
1       SIMPLE  t2      ref     idx     idx     4       const   8       Using index
 
2996
1       SIMPLE  t2      ref     idx     idx     4       const   7       Using index
2994
2997
EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4;
2995
2998
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
2996
2999
1       SIMPLE  t1      const   PRIMARY PRIMARY 4       const   1       
3008
3011
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
3009
3012
1       SIMPLE  t1      const   PRIMARY PRIMARY 4       const   1       
3010
3013
1       SIMPLE  t2      const   idx1    NULL    NULL    NULL    1       
3011
 
1       SIMPLE  t3      ALL     idx1    NULL    NULL    NULL    5       Using where
 
3014
1       SIMPLE  t3      ref     idx1    idx1    5       const   2       Using where
3012
3015
SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
3013
3016
WHERE t1.id=2;
3014
3017
id      a       b       c       d       e
3222
3225
AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31";
3223
3226
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
3224
3227
1       SIMPLE  t2      const   PRIMARY PRIMARY 4       const   1       
3225
 
1       SIMPLE  t1      range   ts      ts      9       NULL    2       Using where
 
3228
1       SIMPLE  t1      range   ts      ts      9       NULL    1       Using where
3226
3229
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30
3227
3230
AND t1.ts BETWEEN t2.dt1 AND t2.dt2
3228
3231
AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31";
3552
3555
c34 INT DEFAULT 0,
3553
3556
KEY (c33, c34, c32));
3554
3557
INSERT INTO t1 values (),(),(),(),();
3555
 
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a CROSS JOIN t1 b;
 
3558
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
3556
3559
INSERT INTO t3 VALUES (1, 1, 1, 0), 
3557
3560
(2, 2, 0, 0), 
3558
3561
(3, 3, 1, 0),