~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/join.result

  • Committer: Monty Taylor
  • Date: 2011-03-10 18:09:05 UTC
  • mfrom: (2225.2.2 refactor)
  • mto: This revision was merged to the branch mainline in revision 2228.
  • Revision ID: mordred@inaugust.com-20110310180905-ttx05t7q7ff6nl7c
Merge Olad: Refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
INSERT INTO t1 VALUES (1);
5
5
INSERT INTO t2 VALUES (2);
6
6
SELECT * FROM t1 JOIN t2;
7
 
S1      S1
8
 
1       2
 
7
ERROR HY000: Implicit cartesian join attempted.
9
8
SELECT * FROM t1 INNER JOIN t2;
10
 
S1      S1
11
 
1       2
 
9
ERROR HY000: Implicit cartesian join attempted.
12
10
SELECT * from t1 JOIN t2 USING (S1);
13
11
S1
14
12
SELECT * FROM t1 INNER JOIN t2 USING (S1);
74
72
count int DEFAULT '0' NOT NULL,
75
73
qty int,
76
74
phone char(1) DEFAULT '' NOT NULL,
77
 
timestamp datetime,
 
75
timestamp_arg datetime,
78
76
PRIMARY KEY (id),
79
77
KEY token (token(15)),
80
 
KEY timestamp (timestamp),
 
78
KEY timestamp_arg (timestamp_arg),
81
79
UNIQUE token_2 (token(75),count,phone)
82
80
);
83
81
INSERT INTO t1 VALUES (21,'e45703b64de71482360de8fec94c3ade',3,7800,'n','1999-12-23 17:22:21');
299
297
CREATE TABLE t2 (b int);
300
298
CREATE TABLE t3 (c int);
301
299
SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3;
302
 
a       b       c
 
300
ERROR HY000: Implicit cartesian join attempted.
303
301
DROP TABLE t1, t2, t3;
304
302
create table t1 (i int);
305
303
create table t2 (i int);
774
772
create table t2 (a int, b int, filler char(100), key(a), key(b));
775
773
create table t3 (a int, b int, filler char(100), key(a), key(b));
776
774
insert into t2 
777
 
select @a:= A.a + 10*(B.a + 10*C.a), @a, 'filler' from t1 A, t1 B, t1 C;
 
775
select @a:= A.a + 10*(B.a + 10*C.a), @a, 'filler' from t1 A, t1 B, t1 C where B.a >= 0;
778
776
insert into t3 select * from t2 where a < 800;
779
777
drop table t1, t2, t3;
780
778
create table t1 (a int);
781
779
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
782
780
create table t2 (a int, b int, primary key(a));
783
 
insert into t2 select @v:=A.a+10*B.a, @v  from t1 A, t1 B;
 
781
insert into t2 select @v:=A.a+10*B.a, @v  from t1 A, t1 B where B.a >= 0;
784
782
explain select * from t1;
785
783
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
786
784
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    10