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

« back to all changes in this revision

Viewing changes to tests/r/key_diff.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
CREATE TABLE t1 (
 
3
a char(5) NOT NULL,
 
4
b char(4) NOT NULL,
 
5
KEY (a),
 
6
KEY (b)
 
7
);
 
8
INSERT INTO t1 VALUES ('A','B'),('b','A'),('C','c'),('D','E'),('a','a');
 
9
select * from t1,t1 as t2;
 
10
a       b       a       b
 
11
A       B       A       B
 
12
b       A       A       B
 
13
C       c       A       B
 
14
D       E       A       B
 
15
a       a       A       B
 
16
A       B       b       A
 
17
b       A       b       A
 
18
C       c       b       A
 
19
D       E       b       A
 
20
a       a       b       A
 
21
A       B       C       c
 
22
b       A       C       c
 
23
C       c       C       c
 
24
D       E       C       c
 
25
a       a       C       c
 
26
A       B       D       E
 
27
b       A       D       E
 
28
C       c       D       E
 
29
D       E       D       E
 
30
a       a       D       E
 
31
A       B       a       a
 
32
b       A       a       a
 
33
C       c       a       a
 
34
D       E       a       a
 
35
a       a       a       a
 
36
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
 
37
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
38
1       SIMPLE  t1      ALL     a       NULL    NULL    NULL    5       
 
39
1       SIMPLE  t2      ALL     b       NULL    NULL    NULL    5       Using where; Using join buffer
 
40
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
 
41
a       b       a       b
 
42
A       B       a       a
 
43
A       B       b       A
 
44
C       c       C       c
 
45
a       a       a       a
 
46
a       a       b       A
 
47
b       A       A       B
 
48
select * from t1 where a='a';
 
49
a       b
 
50
A       B
 
51
a       a
 
52
drop table t1;