~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to plugin/blitzdb/tests/r/join.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2011-03-15 10:41:18 UTC
  • mfrom: (1.2.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110315104118-eaf0hvlytjdl4zrf
Tags: 2011.03.13-0ubuntu1
* New upstream release.
* Added slave plugin.
* Removed archive, blackhole and blitzdb plugins.
* Moved location of libdrizzle headers.
* Removed drizzleadmin manpage patch.
* Add drizzle_safe_write_string to symbols.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1, t2;
2
 
create table t1 (a int) engine = blitzdb;
3
 
create table t2 (a int) engine = blitzdb;
4
 
insert into t1 values (1), (2), (3);
5
 
insert into t2 values (1), (4), (8);
6
 
select * from t1 JOIN t2 where t1.a = t2.a;
7
 
a       a
8
 
1       1
9
 
select * from t1 LEFT JOIN t2 on t1.a = t2.a;
10
 
a       a
11
 
1       1
12
 
2       NULL
13
 
3       NULL
14
 
select * from t1 RIGHT JOIN t2 on t1.a = t2.a;
15
 
a       a
16
 
1       1
17
 
NULL    4
18
 
NULL    8
19
 
select * from t1 UNION select * from t2;
20
 
a
21
 
1
22
 
2
23
 
3
24
 
4
25
 
8
26
 
drop table t1, t2;
27
 
create table t1 (id int, name varchar(32)) engine = blitzdb;
28
 
create table t2 (id int, job_id int) engine = blitzdb;
29
 
create table t3 (job_id int, job_name varchar(32)) engine = blitzdb;
30
 
insert into t1 values (1, 'Alex');
31
 
insert into t1 values (2, 'Bob');
32
 
insert into t1 values (3, 'Curt');
33
 
insert into t1 values (4, 'Dan');
34
 
insert into t1 values (5, 'Edgar');
35
 
insert into t2 values (1, 1);
36
 
insert into t2 values (2, 1);
37
 
insert into t2 values (3, 3);
38
 
insert into t2 values (4, 2);
39
 
insert into t2 values (5, 4);
40
 
insert into t3 values (1, 'Software Engineer');
41
 
insert into t3 values (2, 'Civil Engineer');
42
 
insert into t3 values (3, 'Electrical Engineer');
43
 
insert into t3 values (4, 'Mechanical Engineer');
44
 
select
45
 
t1.name, t3.job_name
46
 
from
47
 
t1 join (t2, t3)
48
 
on
49
 
(t1.id = t2.id and t2.job_id = t3.job_id);
50
 
name    job_name
51
 
Alex    Software Engineer
52
 
Bob     Software Engineer
53
 
Curt    Electrical Engineer
54
 
Dan     Civil Engineer
55
 
Edgar   Mechanical Engineer
56
 
select
57
 
t1.name, t3.job_name
58
 
from
59
 
t1 right join (t2, t3)
60
 
on
61
 
(t1.id = t2.id and t2.job_id = t3.job_id);
62
 
name    job_name
63
 
Alex    Software Engineer
64
 
NULL    Civil Engineer
65
 
NULL    Electrical Engineer
66
 
NULL    Mechanical Engineer
67
 
Bob     Software Engineer
68
 
NULL    Civil Engineer
69
 
NULL    Electrical Engineer
70
 
NULL    Mechanical Engineer
71
 
NULL    Software Engineer
72
 
NULL    Civil Engineer
73
 
Curt    Electrical Engineer
74
 
NULL    Mechanical Engineer
75
 
NULL    Software Engineer
76
 
Dan     Civil Engineer
77
 
NULL    Electrical Engineer
78
 
NULL    Mechanical Engineer
79
 
NULL    Software Engineer
80
 
NULL    Civil Engineer
81
 
NULL    Electrical Engineer
82
 
Edgar   Mechanical Engineer
83
 
delete from t3 where job_id = 4;
84
 
select
85
 
t1.name, t3.job_name
86
 
from
87
 
t1 join (t2, t3)
88
 
on
89
 
(t1.id = t2.id and t2.job_id = t3.job_id);
90
 
name    job_name
91
 
Alex    Software Engineer
92
 
Bob     Software Engineer
93
 
Curt    Electrical Engineer
94
 
Dan     Civil Engineer
95
 
select
96
 
t1.name, t3.job_name
97
 
from
98
 
t1 left join (t2, t3)
99
 
on
100
 
(t1.id = t2.id and t2.job_id = t3.job_id);
101
 
name    job_name
102
 
Alex    Software Engineer
103
 
Bob     Software Engineer
104
 
Curt    Electrical Engineer
105
 
Dan     Civil Engineer
106
 
Edgar   NULL
107
 
drop table t1, t2, t3;