~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/select.test

  • Committer: Andrew Hutchings
  • Date: 2011-02-07 17:01:15 UTC
  • mto: (2148.2.3 build)
  • mto: This revision was merged to the branch mainline in revision 2149.
  • Revision ID: andrew@linuxjedi.co.uk-20110207170115-e4sryp5nkb3n2vhy
Implicit joins of the form "SELECT * FROM t1, t2" without WHERE or ON now error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1534
1534
# Full join (same alias)
1535
1535
#
1536
1536
 
1537
 
select * from t1,t1 t12;
 
1537
select * from t1 CROSS JOIN t1 t12;
1538
1538
--sorted_result
1539
1539
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;
1540
1540
 
2720
2720
create table t1 (a int);
2721
2721
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
2722
2722
create table t2 (a int, b int, c int, e int, primary key(a,b,c));
2723
 
insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
 
2723
insert into t2 select A.a, B.a, C.a, C.a from t1 A CROSS JOIN t1 B CROSS JOIN t1 C;
2724
2724
analyze table t2;
2725
2725
select 'In next EXPLAIN, B.rows must be exactly 10:' Z;
2726
2726
 
3278
3278
                 KEY (c33, c34, c32));
3279
3279
 
3280
3280
INSERT INTO t1 values (),(),(),(),();
3281
 
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a, t1 b;
 
3281
INSERT INTO t2 SELECT a.c11, b.c11 FROM t1 a CROSS JOIN t1 b;
3282
3282
INSERT INTO t3 VALUES (1, 1, 1, 0), 
3283
3283
                      (2, 2, 0, 0), 
3284
3284
                      (3, 3, 1, 0),