1
1
drop table if exists t0,t1,t2,t3,t4,t5;
3
3
grp int default NULL,
4
a bigint unsigned default NULL,
5
5
c char(10) NOT NULL default ''
7
7
INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,'');
8
create table t2 (id int, a bigint unsigned not null, c char(10), d int, primary key (a));
8
create table t2 (id int, a bigint not null, c char(10), d int, primary key (a));
9
9
insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7);
10
10
select t1.*,t2.* from t1 JOIN t2 where t1.a=t2.a;
129
129
drop table t1,t2;
130
130
CREATE TABLE t1 (
131
usr_id INT unsigned NOT NULL,
132
uniq_id INT unsigned NOT NULL AUTO_INCREMENT,
133
start_num INT unsigned NOT NULL DEFAULT 1,
134
increment INT unsigned NOT NULL DEFAULT 1,
132
uniq_id INT NOT NULL AUTO_INCREMENT,
133
start_num INT NOT NULL DEFAULT 1,
134
increment INT NOT NULL DEFAULT 1,
135
135
PRIMARY KEY (uniq_id),
136
136
INDEX usr_uniq_idx (usr_id, uniq_id),
137
137
INDEX uniq_usr_idx (uniq_id, usr_id)
139
139
CREATE TABLE t2 (
140
id INT unsigned NOT NULL DEFAULT 0,
141
usr2_id INT unsigned NOT NULL DEFAULT 0,
142
max INT unsigned NOT NULL DEFAULT 0,
143
c_amount INT unsigned NOT NULL DEFAULT 0,
144
d_max INT unsigned NOT NULL DEFAULT 0,
145
d_num INT unsigned NOT NULL DEFAULT 0,
146
orig_time INT unsigned NOT NULL DEFAULT 0,
147
c_time INT unsigned NOT NULL DEFAULT 0,
140
id INT NOT NULL DEFAULT 0,
141
usr2_id INT NOT NULL DEFAULT 0,
142
max INT NOT NULL DEFAULT 0,
143
c_amount INT NOT NULL DEFAULT 0,
144
d_max INT NOT NULL DEFAULT 0,
145
d_num INT NOT NULL DEFAULT 0,
146
orig_time INT NOT NULL DEFAULT 0,
147
c_time INT NOT NULL DEFAULT 0,
148
148
active ENUM ("no","yes") NOT NULL,
149
149
PRIMARY KEY (id,usr2_id),
150
150
INDEX id_idx (id),
292
292
INSERT INTO t1 VALUES (2,'Lilliana Angelovska');
293
293
INSERT INTO t1 VALUES (3,'Thimble Smith');
294
294
CREATE TABLE t2 (
295
id int unsigned NOT NULL auto_increment,
296
owner int unsigned DEFAULT '0' NOT NULL,
295
id int NOT NULL auto_increment,
296
owner int DEFAULT '0' NOT NULL,
621
621
bug_id reporter bug_id who
623
623
drop table t1,t2;
624
create table t1 (fooID int unsigned auto_increment, primary key (fooID));
625
create table t2 (fooID int unsigned not null, barID int unsigned not null, primary key (fooID,barID));
624
create table t1 (fooID int auto_increment, primary key (fooID));
625
create table t2 (fooID int not null, barID int not null, primary key (fooID,barID));
626
626
insert into t1 (fooID) values (10),(20),(30);
627
627
insert into t2 values (10,1),(20,2),(30,3);
628
628
explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
711
711
drop table t1,t2;
712
712
create table t1 (
713
match_id int unsigned not null auto_increment,
714
home int unsigned default '0',
713
match_id int not null auto_increment,
714
home int default '0',
715
715
unique key match_id (match_id),
716
716
key match_id_2 (match_id)
718
718
insert into t1 values("1", "2");
719
719
create table t2 (
720
player_id int unsigned default '0',
721
match_1_h int unsigned default '0',
720
player_id int default '0',
721
match_1_h int default '0',
722
722
key player_id (player_id)
724
724
insert into t2 values("1", "5");
819
819
DROP TABLE t1,t2;
820
820
CREATE TABLE t1 (
821
id int unsigned NOT NULL auto_increment,
822
text_id int unsigned default NULL,
821
id int NOT NULL auto_increment,
822
text_id int default NULL,
825
825
INSERT INTO t1 VALUES("1", "0");
961
961
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
962
962
drop table t1, t2;
963
963
set group_concat_max_len=default;
964
create table t1 (gid int unsigned not null, x int not null, y int not null, art int not null, primary key (gid,x,y));
964
create table t1 (gid int not null, x int not null, y int not null, art int not null, primary key (gid,x,y));
965
965
insert t1 values (1, -5, -8, 2), (1, 2, 2, 1), (1, 1, 1, 1);
966
create table t2 (gid int unsigned not null, x int not null, y int not null, id int not null, primary key (gid,id,x,y), key id (id));
966
create table t2 (gid int not null, x int not null, y int not null, id int not null, primary key (gid,id,x,y), key id (id));
967
967
insert t2 values (1, -5, -8, 1), (1, 1, 1, 1), (1, 2, 2, 1);
968
create table t3 ( set_id int unsigned not null, id int unsigned not null, name char(12) not null, primary key (id,set_id));
968
create table t3 ( set_id int not null, id int not null, name char(12) not null, primary key (id,set_id));
969
969
insert t3 values (0, 1, 'a'), (1, 1, 'b'), (0, 2, 'c'), (1, 2, 'd'), (1, 3, 'e'), (1, 4, 'f'), (1, 5, 'g'), (1, 6, 'h');
970
970
explain select name from t1 left join t2 on t1.x = t2.x and t1.y = t2.y
971
971
left join t3 on t1.art = t3.id where t2.id =1 and t2.x = -5 and t2.y =-8