1
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
2
drop database if exists mysqltest;
4
pk1 INT NOT NULL PRIMARY KEY,
8
insert into t1 values(1,1);
9
insert into t1 values(2,2);
10
select count(*) from t1;
13
select * from t1 where pk1 = 1;
16
select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
20
select count(*) from t1;
23
select * from t1 where pk1 = 1;
25
select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
28
insert into t1 values(1,1);
29
insert into t1 values(2,2);
31
select count(*) from t1;
34
select * from t1 where pk1 = 1;
37
select t1.attr1 from t1, t1 as t1x where t1.pk1 = t1x.pk1 + 1;
41
update t1 set attr1 = attr1 * 2;
42
select count(*) from t1;
45
select * from t1 where pk1 = 1;
48
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
52
select count(*) from t1;
55
select * from t1 where pk1 = 1;
58
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
61
update t1 set attr1 = attr1 * 2;
63
select count(*) from t1;
66
select * from t1 where pk1 = 1;
69
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
73
delete from t1 where attr1 = 2;
74
select count(*) from t1;
77
select * from t1 where pk1 = 1;
79
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
82
select count(*) from t1;
85
select * from t1 where pk1 = 1;
88
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
92
delete from t1 where attr1 = 2;
94
select count(*) from t1;
97
select * from t1 where pk1 = 1;
99
select * from t1, t1 as t1x where t1x.attr1 = t1.attr1 - 2;
102
CREATE TABLE t1 (id INT, id2 int) engine=ndbcluster;
104
insert into t1 values(1,1);
105
insert into t1 values(2,2);
106
select sum(id) from t1;
109
select * from t1 where id = 1;
112
select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
116
select sum(id) from t1;
119
select * from t1 where id = 1;
121
select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
124
insert into t1 values(1,1);
125
insert into t1 values(2,2);
127
select sum(id) from t1;
130
select * from t1 where id = 1;
133
select t1.id from t1, t1 as t1x where t1.id2 = t1x.id2 + 1;
137
update t1 set id = id * 2;
138
select sum(id) from t1;
141
select * from t1 where id = 2;
144
select * from t1, t1 as t1x where t1x.id = t1.id - 2;
148
select sum(id) from t1;
151
select * from t1 where id = 2;
154
select * from t1, t1 as t1x where t1x.id = t1.id - 2;
157
update t1 set id = id * 2;
159
select sum(id) from t1;
162
select * from t1 where id = 2;
165
select * from t1, t1 as t1x where t1x.id = t1.id - 2;
170
a bigint unsigned NOT NULL PRIMARY KEY,
171
b int unsigned not null,
175
a bigint unsigned NOT NULL,
176
b bigint unsigned not null,
181
a bigint unsigned NOT NULL,
182
b bigint unsigned not null,
183
c bigint unsigned NOT NULL,
187
select count(*) from t2;
190
select count(*) from t3;
193
select count(*) from t4;
196
select count(*) from t2;
199
select count(*) from t3;
202
select count(*) from t4;
211
pk1 INT NOT NULL PRIMARY KEY,
214
create database mysqltest;
217
a bigint unsigned NOT NULL PRIMARY KEY,
218
b int unsigned not null,
222
insert into test.t1 values(1,1);
223
insert into t2 values(1,1,1);
224
insert into test.t1 values(2,2);
225
insert into t2 values(2,2,2);
226
select count(*) from test.t1;
229
select count(*) from t2;
232
select * from test.t1 where pk1 = 1;
235
select * from t2 where a = 1;
239
from test.t1, test.t1 as t1x where test.t1.pk1 = t1x.pk1 + 1;
243
from t2, t2 as t2x where t2.a = t2x.a + 1;
246
select test.t1.pk1, a from test.t1,t2 where b > test.t1.attr1;
250
select count(*) from test.t1;
253
select count(*) from t2;
256
drop table test.t1, t2;
257
drop database mysqltest;