[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.148.57: ~ $
set optimizer_switch='batched_key_access=on,mrr_cost_based=off';
drop table if exists t0,t1,t2,t3,t4,t5;
CREATE TABLE t1 (
grp int(11) default NULL,
a bigint(20) unsigned default NULL,
c char(10) NOT NULL default ''
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,'');
create table t2 (id int, a bigint unsigned not null, c char(10), d int, primary key (a));
insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7);
select t1.*,t2.* from t1 JOIN t2 where t1.a=t2.a;
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) order by t1.grp,t1.a,t2.c;
grp	a	c	id	a	c	d
NULL	NULL		NULL	NULL	NULL	NULL
1	1	a	1	1	a	1
2	2	b	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from { oj t2 left outer join t1 on (t1.a=t2.a) };
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
NULL	NULL	NULL	4	7	D	7
select t1.*,t2.* from t1 as t0,{ oj t2 left outer join t1 on (t1.a=t2.a) } WHERE t0.a=2;
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
NULL	NULL	NULL	4	7	D	7
select t1.*,t2.* from t1 left join t2 using (a);
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
2	2	b	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL
NULL	NULL		NULL	NULL	NULL	NULL
select t1.*,t2.* from t1 left join t2 using (a) where t1.a=t2.a;
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from t1 left join t2 using (a,c);
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
2	2	b	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL
3	4	E	NULL	NULL	NULL	NULL
3	5	C	NULL	NULL	NULL	NULL
3	6	D	NULL	NULL	NULL	NULL
NULL	NULL		NULL	NULL	NULL	NULL
select t1.*,t2.* from t1 left join t2 using (c);
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
1	1	a	3	4	A	4
2	2	b	3	5	B	5
2	3	c	3	6	C	6
3	4	E	NULL	NULL	NULL	NULL
3	5	C	3	6	C	6
3	6	D	4	7	D	7
NULL	NULL		NULL	NULL	NULL	NULL
select t1.*,t2.* from t1 natural left outer join t2;
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
2	2	b	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL
3	4	E	NULL	NULL	NULL	NULL
3	5	C	NULL	NULL	NULL	NULL
3	6	D	NULL	NULL	NULL	NULL
NULL	NULL		NULL	NULL	NULL	NULL
select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id=3;
grp	a	c	id	a	c	d
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id is null;
grp	a	c	id	a	c	d
2	2	b	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL
NULL	NULL		NULL	NULL	NULL	NULL
explain select t1.*,t2.* from t1,t2 where t1.a=t2.a and isnull(t2.a)=1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	7	NULL
1	SIMPLE	t2	ALL	PRIMARY	NULL	NULL	NULL	5	Using where; Using join buffer (Block Nested Loop)
select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
grp	a	c	id	a	c	d	a
1	1	a	1	1	a	1	1
2	2	b	NULL	NULL	NULL	NULL	NULL
2	3	c	NULL	NULL	NULL	NULL	NULL
3	4	E	3	4	A	4	4
3	5	C	3	5	B	5	5
3	6	D	3	6	C	6	6
NULL	NULL		NULL	NULL	NULL	NULL	NULL
explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
ERROR 42S22: Unknown column 't3.a' in 'on clause'
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a);
ERROR 42S22: Unknown column 't3.a' in 'on clause'
select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
ERROR 42S22: Unknown column 't3.a' in 'on clause'
select t1.*,t2.* from t1 inner join t2 using (a);
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from t1 inner join t2 on (t1.a=t2.a);
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
3	4	E	3	4	A	4
3	5	C	3	5	B	5
3	6	D	3	6	C	6
select t1.*,t2.* from t1 natural join t2;
grp	a	c	id	a	c	d
1	1	a	1	1	a	1
drop table t1,t2;
CREATE TABLE t1 (
usr_id INT unsigned NOT NULL,
uniq_id INT unsigned NOT NULL AUTO_INCREMENT,
start_num INT unsigned NOT NULL DEFAULT 1,
increment INT unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (uniq_id),
INDEX usr_uniq_idx (usr_id, uniq_id),
INDEX uniq_usr_idx (uniq_id, usr_id)
);
CREATE TABLE t2 (
id INT unsigned NOT NULL DEFAULT 0,
usr2_id INT unsigned NOT NULL DEFAULT 0,
max INT unsigned NOT NULL DEFAULT 0,
c_amount INT unsigned NOT NULL DEFAULT 0,
d_max INT unsigned NOT NULL DEFAULT 0,
d_num INT unsigned NOT NULL DEFAULT 0,
orig_time INT unsigned NOT NULL DEFAULT 0,
c_time INT unsigned NOT NULL DEFAULT 0,
active ENUM ("no","yes") NOT NULL,
PRIMARY KEY (id,usr2_id),
INDEX id_idx (id),
INDEX usr2_idx (usr2_id)
);
INSERT INTO t1 VALUES (3,NULL,0,50),(3,NULL,0,200),(3,NULL,0,25),(3,NULL,0,84676),(3,NULL,0,235),(3,NULL,0,10),(3,NULL,0,3098),(3,NULL,0,2947),(3,NULL,0,8987),(3,NULL,0,8347654),(3,NULL,0,20398),(3,NULL,0,8976),(3,NULL,0,500),(3,NULL,0,198);
SELECT t1.usr_id,t1.uniq_id,t1.increment,
t2.usr2_id,t2.c_amount,t2.max
FROM t1
LEFT JOIN t2 ON t2.id = t1.uniq_id
WHERE t1.uniq_id = 4
ORDER BY t2.c_amount;
usr_id	uniq_id	increment	usr2_id	c_amount	max
3	4	84676	NULL	NULL	NULL
SELECT t1.usr_id,t1.uniq_id,t1.increment,
t2.usr2_id,t2.c_amount,t2.max
FROM t2
RIGHT JOIN t1 ON t2.id = t1.uniq_id
WHERE t1.uniq_id = 4
ORDER BY t2.c_amount;
usr_id	uniq_id	increment	usr2_id	c_amount	max
3	4	84676	NULL	NULL	NULL
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes');
ERROR 23000: Duplicate entry '2-3' for key 'PRIMARY'
INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes');
SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4 ORDER BY t2.c_amount;
usr_id	uniq_id	increment	usr2_id	c_amount	max
3	4	84676	NULL	NULL	NULL
SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4 GROUP BY t2.c_amount;
usr_id	uniq_id	increment	usr2_id	c_amount	max
3	4	84676	NULL	NULL	NULL
SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 LEFT JOIN t2 ON t2.id = t1.uniq_id WHERE t1.uniq_id = 4;
usr_id	uniq_id	increment	usr2_id	c_amount	max
3	4	84676	NULL	NULL	NULL
drop table t1,t2;
CREATE TABLE t1 (
cod_asig int(11) DEFAULT '0' NOT NULL,
desc_larga_cat varchar(80) DEFAULT '' NOT NULL,
desc_larga_cas varchar(80) DEFAULT '' NOT NULL,
desc_corta_cat varchar(40) DEFAULT '' NOT NULL,
desc_corta_cas varchar(40) DEFAULT '' NOT NULL,
cred_total double(3,1) DEFAULT '0.0' NOT NULL,
pre_requisit int(11),
co_requisit int(11),
preco_requisit int(11),
PRIMARY KEY (cod_asig)
);
INSERT INTO t1 VALUES (10360,'asdfggfg','Introduccion a los  Ordenadores I','asdfggfg','Introduccio Ordinadors I',6.0,NULL,NULL,NULL);
INSERT INTO t1 VALUES (10361,'Components i Circuits Electronics I','Componentes y Circuitos Electronicos I','Components i Circuits Electronics I','Comp. i Circ. Electr. I',6.0,NULL,NULL,NULL);
INSERT INTO t1 VALUES (10362,'Laboratori d`Ordinadors','Laboratorio de Ordenadores','Laboratori d`Ordinadors','Laboratori Ordinadors',4.5,NULL,NULL,NULL);
INSERT INTO t1 VALUES (10363,'Tecniques de Comunicacio Oral i Escrita','Tecnicas de Comunicacion Oral y Escrita','Tecniques de Comunicacio Oral i Escrita','Tec. Com. Oral i Escrita',4.5,NULL,NULL,NULL);
INSERT INTO t1 VALUES (11403,'Projecte Fi de Carrera','Proyecto Fin de Carrera','Projecte Fi de Carrera','PFC',9.0,NULL,NULL,NULL);
INSERT INTO t1 VALUES (11404,'+lgebra lineal','Algebra lineal','+lgebra lineal','+lgebra lineal',15.0,NULL,NULL,NULL);
INSERT INTO t1 VALUES (11405,'+lgebra lineal','Algebra lineal','+lgebra lineal','+lgebra lineal',18.0,NULL,NULL,NULL);
INSERT INTO t1 VALUES (11406,'Calcul Infinitesimal','Cßlculo Infinitesimal','Calcul Infinitesimal','Calcul Infinitesimal',15.0,NULL,NULL,NULL);
CREATE TABLE t2 (
idAssignatura int(11) DEFAULT '0' NOT NULL,
Grup int(11) DEFAULT '0' NOT NULL,
Places smallint(6) DEFAULT '0' NOT NULL,
PlacesOcupades int(11) DEFAULT '0',
PRIMARY KEY (idAssignatura,Grup)
);
INSERT INTO t2 VALUES (10360,12,333,0);
INSERT INTO t2 VALUES (10361,30,2,0);
INSERT INTO t2 VALUES (10361,40,3,0);
INSERT INTO t2 VALUES (10360,45,10,0);
INSERT INTO t2 VALUES (10362,10,12,0);
INSERT INTO t2 VALUES (10360,55,2,0);
INSERT INTO t2 VALUES (10360,70,0,0);
INSERT INTO t2 VALUES (10360,565656,0,0);
INSERT INTO t2 VALUES (10360,32767,7,0);
INSERT INTO t2 VALUES (10360,33,8,0);
INSERT INTO t2 VALUES (10360,7887,85,0);
INSERT INTO t2 VALUES (11405,88,8,0);
INSERT INTO t2 VALUES (10360,0,55,0);
INSERT INTO t2 VALUES (10360,99,0,0);
INSERT INTO t2 VALUES (11411,30,10,0);
INSERT INTO t2 VALUES (11404,0,0,0);
INSERT INTO t2 VALUES (10362,11,111,0);
INSERT INTO t2 VALUES (10363,33,333,0);
INSERT INTO t2 VALUES (11412,55,0,0);
INSERT INTO t2 VALUES (50003,66,6,0);
INSERT INTO t2 VALUES (11403,5,0,0);
INSERT INTO t2 VALUES (11406,11,11,0);
INSERT INTO t2 VALUES (11410,11410,131,0);
INSERT INTO t2 VALUES (11416,11416,32767,0);
INSERT INTO t2 VALUES (11409,0,0,0);
CREATE TABLE t3 (
id int(11) NOT NULL auto_increment,
dni_pasaporte char(16) DEFAULT '' NOT NULL,
idPla int(11) DEFAULT '0' NOT NULL,
cod_asig int(11) DEFAULT '0' NOT NULL,
any smallint(6) DEFAULT '0' NOT NULL,
quatrimestre smallint(6) DEFAULT '0' NOT NULL,
estat char(1) DEFAULT 'M' NOT NULL,
PRIMARY KEY (id),
UNIQUE dni_pasaporte (dni_pasaporte,idPla),
UNIQUE dni_pasaporte_2 (dni_pasaporte,idPla,cod_asig,any,quatrimestre)
);
INSERT INTO t3 VALUES (1,'11111111',1,10362,98,1,'M');
CREATE TABLE t4 (
id int(11) NOT NULL auto_increment,
papa int(11) DEFAULT '0' NOT NULL,
fill int(11) DEFAULT '0' NOT NULL,
idPla int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY papa (idPla,papa),
UNIQUE papa_2 (idPla,papa,fill)
);
INSERT INTO t4 VALUES (1,-1,10360,1);
INSERT INTO t4 VALUES (2,-1,10361,1);
INSERT INTO t4 VALUES (3,-1,10362,1);
SELECT DISTINCT fill,desc_larga_cat,cred_total,Grup,Places,PlacesOcupades FROM t4 LEFT JOIN t3 ON t3.cod_asig=fill AND estat='S'   AND dni_pasaporte='11111111'   AND t3.idPla=1 , t2,t1 WHERE fill=t1.cod_asig   AND Places>PlacesOcupades   AND fill=idAssignatura   AND t4.idPla=1   AND papa=-1;
fill	desc_larga_cat	cred_total	Grup	Places	PlacesOcupades
10360	asdfggfg	6.0	12	333	0
10361	Components i Circuits Electronics I	6.0	30	2	0
10361	Components i Circuits Electronics I	6.0	40	3	0
10360	asdfggfg	6.0	45	10	0
10362	Laboratori d`Ordinadors	4.5	10	12	0
10360	asdfggfg	6.0	55	2	0
10360	asdfggfg	6.0	32767	7	0
10360	asdfggfg	6.0	33	8	0
10360	asdfggfg	6.0	7887	85	0
10360	asdfggfg	6.0	0	55	0
10362	Laboratori d`Ordinadors	4.5	11	111	0
SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ;
fill	idPla
10360	NULL
10361	NULL
10362	NULL
INSERT INTO t3 VALUES (3,'1234',1,10360,98,1,'S');
SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ;
fill	idPla
10360	1
10361	NULL
10362	NULL
drop table t1,t2,t3,test.t4;
CREATE TABLE t1 (
id smallint(5) unsigned NOT NULL auto_increment,
name char(60) DEFAULT '' NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO t1 VALUES (1,'Antonio Paz');
INSERT INTO t1 VALUES (2,'Lilliana Angelovska');
INSERT INTO t1 VALUES (3,'Thimble Smith');
CREATE TABLE t2 (
id smallint(5) unsigned NOT NULL auto_increment,
owner smallint(5) unsigned DEFAULT '0' NOT NULL,
name char(60),
PRIMARY KEY (id)
);
INSERT INTO t2 VALUES (1,1,'El Gato');
INSERT INTO t2 VALUES (2,1,'Perrito');
INSERT INTO t2 VALUES (3,3,'Happy');
select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner);
name	name	id
Antonio Paz	El Gato	1
Antonio Paz	Perrito	2
Lilliana Angelovska	NULL	NULL
Thimble Smith	Happy	3
select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null;
name	name	id
Lilliana Angelovska	NULL	NULL
explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	3	Using where; Not exists; Using join buffer (Block Nested Loop)
explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.name is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer (Block Nested Loop)
select count(*) from t1 left join t2 on (t1.id = t2.owner);
count(*)
4
select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner);
name	name	id
Antonio Paz	El Gato	1
Antonio Paz	Perrito	2
Lilliana Angelovska	NULL	NULL
Thimble Smith	Happy	3
select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null;
name	name	id
Lilliana Angelovska	NULL	NULL
explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	3	Using where; Not exists; Using join buffer (Block Nested Loop)
explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.name is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	3	Using where; Using join buffer (Block Nested Loop)
select count(*) from t2 right join t1 on (t1.id = t2.owner);
count(*)
4
select t1.name, t2.name, t2.id,t3.id from t2 right join t1 on (t1.id = t2.owner) left join t1 as t3 on t3.id=t2.owner;
name	name	id	id
Antonio Paz	El Gato	1	1
Antonio Paz	Perrito	2	1
Lilliana Angelovska	NULL	NULL	NULL
Thimble Smith	Happy	3	3
select t1.name, t2.name, t2.id,t3.id from t1 right join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner;
name	name	id	id
Antonio Paz	El Gato	1	1
Antonio Paz	Perrito	2	1
Thimble Smith	Happy	3	3
NULL	NULL	NULL	2
select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner;
name	name	id	owner	id
Antonio Paz	El Gato	1	1	1
Antonio Paz	Perrito	2	1	1
Thimble Smith	Happy	3	3	3
NULL	NULL	NULL	NULL	2
drop table t1,t2;
create table t1 (id int not null, str char(10), index(str));
insert into t1 values (1, null), (2, null), (3, "foo"), (4, "bar");
select * from t1 where str is not null order by id;
id	str
3	foo
4	bar
select * from t1 where str is null;
id	str
1	NULL
2	NULL
drop table t1;
CREATE TABLE t1 (
t1_id bigint(21) NOT NULL auto_increment,
PRIMARY KEY (t1_id)
);
CREATE TABLE t2 (
t2_id bigint(21) NOT NULL auto_increment,
PRIMARY KEY (t2_id)
);
CREATE TABLE t3 (
t3_id bigint(21) NOT NULL auto_increment,
PRIMARY KEY (t3_id)
);
CREATE TABLE t4 (
seq_0_id bigint(21) DEFAULT '0' NOT NULL,
seq_1_id bigint(21) DEFAULT '0' NOT NULL,
KEY seq_0_id (seq_0_id),
KEY seq_1_id (seq_1_id)
);
CREATE TABLE t5 (
seq_0_id bigint(21) DEFAULT '0' NOT NULL,
seq_1_id bigint(21) DEFAULT '0' NOT NULL,
KEY seq_1_id (seq_1_id),
KEY seq_0_id (seq_0_id)
);
insert into t1 values (1);
insert into t2 values (1);
insert into t3 values (1);
insert into t4 values (1,1);
insert into t5 values (1,1);
explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23;
ERROR 42S22: Unknown column 't2.t2_id' in 'on clause'
drop table t1,t2,t3,t4,t5;
create table t1 (n int, m int, o int, key(n));
create table t2 (n int not null, m int, o int, primary key(n));
insert into t1 values (1, 2, 11), (1, 2, 7), (2, 2, 8), (1,2,9),(1,3,9);
insert into t2 values (1, 2, 3),(2, 2, 8), (4,3,9),(3,2,10);
select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and
t1.m = t2.m where t1.n = 1;
n	m	o	n	m	o
1	2	11	1	2	3
1	2	7	1	2	3
1	2	9	1	2	3
1	3	9	NULL	NULL	NULL
select t1.*, t2.* from t1 left join t2 on t1.n = t2.n and
t1.m = t2.m where t1.n = 1 order by t1.o,t1.m;
n	m	o	n	m	o
1	2	7	1	2	3
1	2	9	1	2	3
1	3	9	NULL	NULL	NULL
1	2	11	1	2	3
drop table t1,t2;
CREATE TABLE t1 (id1 INT NOT NULL PRIMARY KEY, dat1 CHAR(1), id2 INT);
INSERT INTO t1 VALUES (1,'a',1);
INSERT INTO t1 VALUES (2,'b',1);
INSERT INTO t1 VALUES (3,'c',2);
CREATE TABLE t2 (id2 INT NOT NULL PRIMARY KEY, dat2 CHAR(1));
INSERT INTO t2 VALUES (1,'x');
INSERT INTO t2 VALUES (2,'y');
INSERT INTO t2 VALUES (3,'z');
SELECT t2.id2 FROM t2 LEFT OUTER JOIN t1 ON t1.id2 = t2.id2 WHERE id1 IS NULL;
id2
3
SELECT t2.id2 FROM t2 NATURAL LEFT OUTER JOIN t1 WHERE id1 IS NULL;
id2
3
drop table t1,t2;
create table t1 ( color varchar(20), name varchar(20) );
insert into t1 values ( 'red', 'apple' );
insert into t1 values ( 'yellow', 'banana' );
insert into t1 values ( 'green', 'lime' );
insert into t1 values ( 'black', 'grape' );
insert into t1 values ( 'blue', 'blueberry' );
create table t2 ( count int, color varchar(20) );
insert into t2 values (10, 'green');
insert into t2 values (5, 'black');
insert into t2 values (15, 'white');
insert into t2 values (7, 'green');
select * from t1;
color	name
red	apple
yellow	banana
green	lime
black	grape
blue	blueberry
select * from t2;
count	color
10	green
5	black
15	white
7	green
select * from t2 natural join t1;
color	count	name
green	10	lime
green	7	lime
black	5	grape
select t2.count, t1.name from t2 natural join t1;
count	name
10	lime
7	lime
5	grape
select t2.count, t1.name from t2 inner join t1 using (color);
count	name
10	lime
7	lime
5	grape
drop table t1;
drop table t2;
CREATE TABLE t1 (
pcode varchar(8) DEFAULT '' NOT NULL
);
INSERT INTO t1 VALUES ('kvw2000'),('kvw2001'),('kvw3000'),('kvw3001'),('kvw3002'),('kvw3500'),('kvw3501'),('kvw3502'),('kvw3800'),('kvw3801'),('kvw3802'),('kvw3900'),('kvw3901'),('kvw3902'),('kvw4000'),('kvw4001'),('kvw4002'),('kvw4200'),('kvw4500'),('kvw5000'),('kvw5001'),('kvw5500'),('kvw5510'),('kvw5600'),('kvw5601'),('kvw6000'),('klw1000'),('klw1020'),('klw1500'),('klw2000'),('klw2001'),('klw2002'),('kld2000'),('klw2500'),('kmw1000'),('kmw1500'),('kmw2000'),('kmw2001'),('kmw2100'),('kmw3000'),('kmw3200');
CREATE TABLE t2 (
pcode varchar(8) DEFAULT '' NOT NULL,
KEY pcode (pcode)
);
INSERT INTO t2 VALUES ('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw2000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3000'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw3500'),('kvw6000'),('kvw6000'),('kld2000');
SELECT t1.pcode, IF(ISNULL(t2.pcode), 0, COUNT(*)) AS count FROM t1
LEFT JOIN t2 ON t1.pcode = t2.pcode GROUP BY t1.pcode;
pcode	count
kld2000	1
klw1000	0
klw1020	0
klw1500	0
klw2000	0
klw2001	0
klw2002	0
klw2500	0
kmw1000	0
kmw1500	0
kmw2000	0
kmw2001	0
kmw2100	0
kmw3000	0
kmw3200	0
kvw2000	26
kvw2001	0
kvw3000	36
kvw3001	0
kvw3002	0
kvw3500	26
kvw3501	0
kvw3502	0
kvw3800	0
kvw3801	0
kvw3802	0
kvw3900	0
kvw3901	0
kvw3902	0
kvw4000	0
kvw4001	0
kvw4002	0
kvw4200	0
kvw4500	0
kvw5000	0
kvw5001	0
kvw5500	0
kvw5510	0
kvw5600	0
kvw5601	0
kvw6000	2
SELECT SQL_BIG_RESULT t1.pcode, IF(ISNULL(t2.pcode), 0, COUNT(*)) AS count FROM t1 LEFT JOIN t2 ON t1.pcode = t2.pcode GROUP BY t1.pcode;
pcode	count
kld2000	1
klw1000	0
klw1020	0
klw1500	0
klw2000	0
klw2001	0
klw2002	0
klw2500	0
kmw1000	0
kmw1500	0
kmw2000	0
kmw2001	0
kmw2100	0
kmw3000	0
kmw3200	0
kvw2000	26
kvw2001	0
kvw3000	36
kvw3001	0
kvw3002	0
kvw3500	26
kvw3501	0
kvw3502	0
kvw3800	0
kvw3801	0
kvw3802	0
kvw3900	0
kvw3901	0
kvw3902	0
kvw4000	0
kvw4001	0
kvw4002	0
kvw4200	0
kvw4500	0
kvw5000	0
kvw5001	0
kvw5500	0
kvw5510	0
kvw5600	0
kvw5601	0
kvw6000	2
drop table t1,t2;
CREATE TABLE t1 (
id int(11),
pid int(11),
rep_del tinyint(4),
KEY id (id),
KEY pid (pid)
);
INSERT INTO t1 VALUES (1,NULL,NULL);
INSERT INTO t1 VALUES (2,1,NULL);
select * from t1 LEFT JOIN t1 t2 ON (t1.id=t2.pid) AND t2.rep_del IS NULL;
id	pid	rep_del	id	pid	rep_del
1	NULL	NULL	2	1	NULL
2	1	NULL	NULL	NULL	NULL
create index rep_del ON t1(rep_del);
select * from t1 LEFT JOIN t1 t2 ON (t1.id=t2.pid) AND t2.rep_del IS NULL;
id	pid	rep_del	id	pid	rep_del
1	NULL	NULL	2	1	NULL
2	1	NULL	NULL	NULL	NULL
drop table t1;
CREATE TABLE t1 (
id int(11) DEFAULT '0' NOT NULL,
name tinytext DEFAULT '' NOT NULL,
UNIQUE id (id)
);
Warnings:
Warning	1101	BLOB/TEXT column 'name' can't have a default value
INSERT INTO t1 VALUES (1,'yes'),(2,'no');
CREATE TABLE t2 (
id int(11) DEFAULT '0' NOT NULL,
idx int(11) DEFAULT '0' NOT NULL,
UNIQUE id (id,idx)
);
INSERT INTO t2 VALUES (1,1);
explain SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	NULL
1	SIMPLE	t2	ref	id	id	4	test.t1.id	1	Using where; Not exists; Using index
SELECT * from t1 left join t2 on t1.id=t2.id where t2.id IS NULL;
id	name	id	idx
2	no	NULL	NULL
drop table t1,t2;
create table t1 (bug_id mediumint, reporter mediumint);
create table t2 (bug_id mediumint, who mediumint, index(who));
insert into t2 values (1,1),(1,2);
insert into t1 values (1,1),(2,1);
SELECT * FROM t1 LEFT JOIN t2 ON (t1.bug_id =  t2.bug_id AND  t2.who = 2) WHERE  (t1.reporter = 2 OR t2.who = 2);
bug_id	reporter	bug_id	who
1	1	1	2
drop table t1,t2;
create table t1 (fooID smallint unsigned auto_increment, primary key (fooID));
create table t2 (fooID smallint unsigned not null, barID smallint unsigned not null, primary key (fooID,barID));
insert into t1 (fooID) values (10),(20),(30);
insert into t2 values (10,1),(20,2),(30,3);
explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	index	NULL	PRIMARY	4	NULL	3	Using index
1	SIMPLE	t1	const	PRIMARY	PRIMARY	2	const	1	Using where; Using index
select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
fooID	barID	fooID
10	1	NULL
20	2	NULL
30	3	30
select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30;
fooID	barID	fooID
10	1	NULL
20	2	NULL
30	3	30
drop table t1,t2;
create table t1 (i int);
create table t2 (i int);
create table t3 (i int);
insert into t1 values(1),(2);
insert into t2 values(2),(3);
insert into t3 values(2),(4);
select * from t1 natural left join t2 natural left join t3;
i
1
2
select * from t1 natural left join t2 where (t2.i is not null)=0;
i
1
select * from t1 natural left join t2 where (t2.i is not null) is not null;
i
1
2
select * from t1 natural left join t2 where (i is not null)=0;
i
select * from t1 natural left join t2 where (i is not null) is not null;
i
1
2
drop table t1,t2,t3;
create table t1 (f1 integer,f2 integer,f3 integer);
create table t2 (f2 integer,f4 integer);
create table t3 (f3 integer,f5 integer);
select * from t1
left outer join t2 using (f2)
left outer join t3 using (f3);
f3	f2	f1	f4	f5
drop table t1,t2,t3;
create table t1 (a1 int, a2 int);
create table t2 (b1 int not null, b2 int);
create table t3 (c1 int, c2 int);
insert into t1 values (1,2), (2,2), (3,2);
insert into t2 values (1,3), (2,3);
insert into t3 values (2,4),        (3,4);
select * from t1 left join t2  on  b1 = a1 left join t3  on  c1 = a1  and  b1 is null;
a1	a2	b1	b2	c1	c2
1	2	1	3	NULL	NULL
2	2	2	3	NULL	NULL
3	2	NULL	NULL	3	4
explain select * from t1 left join t2  on  b1 = a1 left join t3  on  c1 = a1  and  b1 is null;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
drop table t1, t2, t3;
create table t1 (
a int(11),
b char(10),
key (a)
);
insert into t1 (a) values (1),(2),(3),(4);
create table t2 (a int);
select * from t1 left join t2 on t1.a=t2.a where not (t2.a <=> t1.a);
a	b	a
1	NULL	NULL
2	NULL	NULL
3	NULL	NULL
4	NULL	NULL
select * from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a);
a	b	a
1	NULL	NULL
2	NULL	NULL
3	NULL	NULL
4	NULL	NULL
drop table t1,t2;
create table t1 (
match_id tinyint(3) unsigned not null auto_increment,
home tinyint(3) unsigned default '0',
unique key match_id (match_id),
key match_id_2 (match_id)
);
insert into t1 values("1", "2");
create table t2 (
player_id tinyint(3) unsigned default '0',
match_1_h tinyint(3) unsigned default '0',
key player_id (player_id)
);
insert into t2 values("1", "5");
insert into t2 values("2", "9");
insert into t2 values("3", "3");
insert into t2 values("4", "7");
insert into t2 values("5", "6");
insert into t2 values("6", "8");
insert into t2 values("7", "4");
insert into t2 values("8", "12");
insert into t2 values("9", "11");
insert into t2 values("10", "10");
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from 
(t2 s left join t1 m on m.match_id = 1) 
order by m.match_id desc;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	s	ALL	NULL	NULL	NULL	NULL	10	Using temporary; Using filesort
1	SIMPLE	m	const	match_id,match_id_2	match_id	1	const	1	Using join buffer (Batched Key Access)
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from 
(t2 s left join t1 m on m.match_id = 1) 
order by UUX desc;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	s	ALL	NULL	NULL	NULL	NULL	10	Using temporary; Using filesort
1	SIMPLE	m	const	match_id,match_id_2	match_id	1	const	1	Using join buffer (Batched Key Access)
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from 
(t2 s left join t1 m on m.match_id = 1) 
order by UUX desc;
player_id	match_1_h	*	match_id	home	UUX
8	12	*	1	2	10
9	11	*	1	2	9
10	10	*	1	2	8
2	9	*	1	2	7
6	8	*	1	2	6
4	7	*	1	2	5
5	6	*	1	2	4
1	5	*	1	2	3
7	4	*	1	2	2
3	3	*	1	2	1
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from 
t2 s straight_join t1 m where m.match_id = 1 
order by UUX desc;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	s	ALL	NULL	NULL	NULL	NULL	10	Using temporary; Using filesort
1	SIMPLE	m	const	match_id,match_id_2	match_id	1	const	1	Using join buffer (Batched Key Access)
select s.*, '*', m.*, (s.match_1_h - m.home) UUX from 
t2 s straight_join t1 m where m.match_id = 1 
order by UUX desc;
player_id	match_1_h	*	match_id	home	UUX
8	12	*	1	2	10
9	11	*	1	2	9
10	10	*	1	2	8
2	9	*	1	2	7
6	8	*	1	2	6
4	7	*	1	2	5
5	6	*	1	2	4
1	5	*	1	2	3
7	4	*	1	2	2
3	3	*	1	2	1
drop table t1, t2;
create table t1 (a int, b int, unique index idx (a, b));
create table t2 (a int, b int, c int, unique index idx (a, b));
insert into t1 values (1, 10), (1,11), (2,10), (2,11);
insert into t2 values (1,10,3);
select t1.a, t1.b, t2.c from t1 left join t2
on t1.a=t2.a and t1.b=t2.b and t2.c=3
where t1.a=1 and t2.c is null;
a	b	c
1	11	NULL
drop table t1, t2;
CREATE TABLE t1 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE t2 (
ts_id bigint(20) default NULL,
inst_id tinyint(4) default NULL,
flag_name varchar(64) default NULL,
flag_value text,
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
(111056548820001, 0, 'flag1', NULL),
(111056548820001, 0, 'flag2', NULL),
(2, 0, 'other_flag', NULL);
INSERT INTO t2 VALUES
(111056548820001, 3, 'flag1', 'sss');
SELECT t1.flag_name,t2.flag_value 
FROM t1 LEFT JOIN t2 
ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND
t2.inst_id = 3) 
WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND
t2.flag_value IS  NULL;
flag_name	flag_value
flag2	NULL
DROP TABLE t1,t2;
CREATE TABLE t1 (
id int(11) unsigned NOT NULL auto_increment,
text_id int(10) unsigned default NULL,
PRIMARY KEY  (id)
);
INSERT INTO t1 VALUES("1", "0");
INSERT INTO t1 VALUES("2", "10");
CREATE TABLE t2 (
text_id char(3) NOT NULL default '',
language_id char(3) NOT NULL default '',
text_data text,
PRIMARY KEY  (text_id,language_id)
);
INSERT INTO t2 VALUES("0", "EN", "0-EN");
INSERT INTO t2 VALUES("0", "SV", "0-SV");
INSERT INTO t2 VALUES("10", "EN", "10-EN");
INSERT INTO t2 VALUES("10", "SV", "10-SV");
SELECT t1.id, t1.text_id, t2.text_data
FROM t1 LEFT JOIN t2
ON t1.text_id = t2.text_id
AND t2.language_id = 'SV'
  WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
id	text_id	text_data
1	0	0-SV
2	10	10-SV
DROP TABLE t1, t2;
CREATE TABLE t0 (a0 int PRIMARY KEY);
CREATE TABLE t1 (a1 int PRIMARY KEY);
CREATE TABLE t2 (a2 int);
CREATE TABLE t3 (a3 int);
INSERT INTO t0 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1), (2);
INSERT INTO t3 VALUES (1), (2);
SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
a1	a2
1	NULL
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON a1=0;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
a1	a2	a3
1	NULL	NULL
EXPLAIN SELECT * FROM t1 LEFT JOIN (t2,t3) ON a1=0;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	2	NULL
SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
a0	a1	a2	a3
1	1	NULL	NULL
EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=0 WHERE a0=a1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t0	system	PRIMARY	NULL	NULL	NULL	1	NULL
1	SIMPLE	t1	system	PRIMARY	NULL	NULL	NULL	1	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	2	NULL
INSERT INTO t0 VALUES (0);
INSERT INTO t1 VALUES (0);
SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
a0	a1	a2	a3
1	1	NULL	NULL
EXPLAIN SELECT * FROM t0, t1 LEFT JOIN (t2,t3) ON a1=5 WHERE a0=a1 AND a0=1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t0	const	PRIMARY	PRIMARY	4	const	1	Using index
1	SIMPLE	t1	const	PRIMARY	PRIMARY	4	const	1	Using index
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	2	NULL
drop table t1,t2;
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3);
create table t2 (a int, b int);
insert into t2 values (1,1), (2,2);
select * from t2 right join t1 on t2.a=t1.a;
a	b	a	b
1	1	1	1
2	2	2	2
NULL	NULL	3	3
select straight_join * from t2 right join t1 on t2.a=t1.a;
a	b	a	b
1	1	1	1
2	2	2	2
NULL	NULL	3	3
DROP TABLE t0,t1,t2,t3;
CREATE TABLE t1 (a int PRIMARY KEY, b int);
CREATE TABLE t2 (a int PRIMARY KEY, b int);
INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2);
INSERT INTO t2 VALUES (1,2), (2,2);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
a	b	a	b
1	1	1	2
2	1	2	2
3	1	NULL	NULL
4	2	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
a	b	a	b
1	1	1	2
2	1	2	2
3	1	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
a	b	a	b
1	1	1	2
2	1	2	2
3	1	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
a	b	a	b
1	1	1	2
2	1	2	2
3	1	NULL	NULL
4	2	NULL	NULL
DROP TABLE t1,t2;
set group_concat_max_len=5;
create table t1 (a int, b varchar(20));
create table t2 (a int, c varchar(20));
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
Warning	1260	Row 1 was cut by GROUP_CONCAT()
Warning	1260	Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key  (gid,x,y));
insert t1 values (1, -5, -8, 2), (1, 2, 2, 1), (1, 1, 1, 1);
create table t2 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, id int(11) not null, primary key  (gid,id,x,y), key id (id));
insert t2 values (1, -5, -8, 1), (1, 1, 1, 1), (1, 2, 2, 1);
create table t3 ( set_id smallint(5) unsigned not null, id tinyint(4) unsigned not null, name char(12) not null, primary key  (id,set_id));
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');
explain select name from t1 left join t2 on t1.x = t2.x and t1.y = t2.y
left join t3 on t1.art = t3.id where t2.id =1 and t2.x = -5 and t2.y =-8
and t1.gid =1 and t2.gid =1 and t3.set_id =1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	const	PRIMARY	PRIMARY	10	const,const,const	1	NULL
1	SIMPLE	t2	const	PRIMARY,id	PRIMARY	14	const,const,const,const	1	Using index
1	SIMPLE	t3	const	PRIMARY	PRIMARY	3	const,const	1	NULL
drop tables t1,t2,t3;
CREATE TABLE t1 (EMPNUM INT, GRP INT);
INSERT INTO t1 VALUES (0, 10);
INSERT INTO t1 VALUES (2, 30);
CREATE TABLE t2 (EMPNUM INT, NAME CHAR(5));
INSERT INTO t2 VALUES (0, 'KERI');
INSERT INTO t2 VALUES (9, 'BARRY');
CREATE VIEW v1 AS
SELECT COALESCE(t2.EMPNUM,t1.EMPNUM) AS EMPNUM, NAME, GRP
FROM t2 LEFT OUTER JOIN t1 ON t2.EMPNUM=t1.EMPNUM;
SELECT * FROM v1;
EMPNUM	NAME	GRP
0	KERI	10
9	BARRY	NULL
SELECT * FROM v1 WHERE EMPNUM < 10;
EMPNUM	NAME	GRP
0	KERI	10
9	BARRY	NULL
DROP VIEW v1;
DROP TABLE t1,t2;
CREATE TABLE t1 (c11 int);
CREATE TABLE t2 (c21 int);
INSERT INTO t1 VALUES (30), (40), (50);
INSERT INTO t2 VALUES (300), (400), (500);
SELECT * FROM t1 LEFT JOIN t2 ON (c11=c21 AND c21=30) WHERE c11=40;
c11	c21
40	NULL
DROP TABLE t1, t2;
CREATE TABLE t1 (a int PRIMARY KEY, b int);
CREATE TABLE t2 (a int PRIMARY KEY, b int);
INSERT INTO t1 VALUES (1,2), (2,1), (3,2), (4,3), (5,6), (6,5), (7,8), (8,7), (9,10);
INSERT INTO t2 VALUES (3,0), (4,1), (6,4), (7,5);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b <= t1.a AND t1.a <= t1.b;
a	b	a	b
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a BETWEEN t2.b AND t1.b;
a	b	a	b
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a NOT BETWEEN t2.b AND t1.b);
a	b	a	b
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b > t1.a OR t1.a > t1.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
2	1	NULL	NULL
8	7	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT BETWEEN t2.b AND t1.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
2	1	NULL	NULL
8	7	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a BETWEEN t2.b AND t1.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
2	1	NULL	NULL
8	7	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t2.b > t1.a OR t1.a > t1.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
2	1	NULL	NULL
8	7	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a AND t1.a BETWEEN t2.b AND t1.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
2	1	NULL	NULL
8	7	NULL	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a AND (t2.b > t1.a OR t1.a > t1.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a OR t1.a BETWEEN t2.b AND t1.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t1.a = t2.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a IN(t2.a, t2.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a NOT IN(t2.a, t2.b));
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a != t1.b AND t1.a != t2.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT IN(t1.b, t2.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a IN(t1.b, t2.b));
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.a != t2.b OR (t1.a != t2.a AND t1.a != t2.b);
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t2.a = t2.b AND t1.a IN(t2.a, t2.b));
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.a != t2.b AND t1.a != t1.b AND t1.a != t2.b;
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t2.a = t2.b OR t1.a IN(t1.b, t2.b));
a	b	a	b
3	2	3	0
4	3	4	1
6	5	6	4
7	8	7	5
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t1.a = t2.b;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ALL	PRIMARY	NULL	NULL	NULL	4	Using where
1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.a	1	Using join buffer (Batched Key Access)
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a IN(t2.a, t2.b);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ALL	PRIMARY	NULL	NULL	NULL	4	Using where
1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.a	1	Using join buffer (Batched Key Access)
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a > IF(t1.a = t2.b-2, t2.b, t2.b-1);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ALL	PRIMARY	NULL	NULL	NULL	4	Using where
1	SIMPLE	t1	eq_ref	PRIMARY	PRIMARY	4	test.t2.a	1	Using join buffer (Batched Key Access)
DROP TABLE t1,t2;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (a int);
CREATE table t2 (b int);
INSERT INTO t1 VALUES (1), (2), (3), (4), (1), (1), (3);
INSERT INTO t2 VALUES (2), (3);
CREATE VIEW v1 AS SELECT a FROM t1 JOIN t2 ON t1.a=t2.b;
CREATE VIEW v2 AS SELECT b FROM t2 JOIN t1 ON t2.b=t1.a;
SELECT v1.a, v2. b 
FROM v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3)
GROUP BY v1.a;
a	b
2	NULL
3	3
SELECT v1.a, v2. b 
FROM { OJ v1 LEFT OUTER JOIN v2 ON (v1.a=v2.b) AND (v1.a >= 3) }
GROUP BY v1.a;
a	b
2	NULL
3	3
DROP VIEW v1,v2;
DROP TABLE t1,t2;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (b int);
INSERT INTO t1 VALUES (1), (2), (3), (4);
INSERT INTO t2 VALUES (2), (3);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1);
a	b
1	NULL
2	2
3	3
4	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1 OR 1);
a	b
1	NULL
2	2
3	3
4	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (0 OR 1);
a	b
1	NULL
2	2
3	3
4	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2);
a	b
1	NULL
2	2
3	3
4	NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0);
a	b
1	NULL
2	2
3	3
4	NULL
DROP TABLE t1,t2;
CREATE TABLE t1 (
f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
f2 varchar(16) collate latin1_swedish_ci
);
CREATE TABLE t2 (
f1 varchar(16) collate latin1_swedish_ci PRIMARY KEY,
f3 varchar(16) collate latin1_swedish_ci
);
INSERT INTO t1 VALUES ('bla','blah');
INSERT INTO t2 VALUES ('bla','sheep');
SELECT * FROM t1 JOIN t2 USING(f1) WHERE f1='Bla';
f1	f2	f3
bla	blah	sheep
SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='bla';
f1	f2	f3
bla	blah	sheep
SELECT * FROM t1 LEFT JOIN t2 USING(f1) WHERE f1='Bla';
f1	f2	f3
bla	blah	sheep
DROP TABLE t1,t2;
CREATE TABLE t1 (id int PRIMARY KEY, a varchar(8));
CREATE TABLE t2 (id int NOT NULL, b int NOT NULL, INDEX idx(id));
INSERT INTO t1 VALUES
(1,'aaaaaaa'), (5,'eeeeeee'), (4,'ddddddd'), (2,'bbbbbbb'), (3,'ccccccc');
INSERT INTO t2 VALUES
(3,10), (2,20), (5,30), (3,20), (5,10), (3,40), (3,30), (2,10), (2,40);
EXPLAIN
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	5	NULL
1	SIMPLE	t2	ALL	idx	NULL	NULL	NULL	9	Using where; Not exists; Using join buffer (Block Nested Loop)
flush status;
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id	a
1	aaaaaaa
4	ddddddd
show status like 'Handler_read%';
Variable_name	Value
Handler_read_first	0
Handler_read_key	0
Handler_read_last	0
Handler_read_next	0
Handler_read_prev	0
Handler_read_rnd	0
Handler_read_rnd_next	16
DROP TABLE t1,t2;
CREATE TABLE t1 (c int  PRIMARY KEY, e int NOT NULL);
INSERT INTO t1 VALUES (1,0), (2,1);
CREATE TABLE t2 (d int PRIMARY KEY);
INSERT INTO t2 VALUES (1), (2), (3);
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	const	PRIMARY	PRIMARY	4	const	1	NULL
1	SIMPLE	t2	index	NULL	PRIMARY	4	NULL	3	Using where; Not exists; Using index
SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d IS NULL;
c	e	d
1	0	NULL
SELECT * FROM t1 LEFT JOIN t2 ON e<>0 WHERE c=1 AND d<=>NULL;
c	e	d
1	0	NULL
DROP TABLE t1,t2;
#
# Bug#47650: using group by with rollup without indexes returns incorrect 
# results with where
#
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 ( a INT, b INT );
INSERT INTO t2 VALUES (1, 1),(1, 2),(1, 3),(2, 4),(2, 5);
EXPLAIN
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
FROM t1 LEFT JOIN t2 USING( a )
GROUP BY t1.a WITH ROLLUP;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	Using temporary; Using filesort
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
FROM t1 LEFT JOIN t2 USING( a )
GROUP BY t1.a WITH ROLLUP;
a	COUNT( t2.b )	SUM( t2.b )	MAX( t2.b )
1	3	6	3
NULL	3	6	3
EXPLAIN
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
FROM t1 JOIN t2 USING( a )
GROUP BY t1.a WITH ROLLUP;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	Using filesort
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	5	Using where
SELECT t1.a, COUNT( t2.b ), SUM( t2.b ), MAX( t2.b )
FROM t1 JOIN t2 USING( a )
GROUP BY t1.a WITH ROLLUP;
a	COUNT( t2.b )	SUM( t2.b )	MAX( t2.b )
1	3	6	3
NULL	3	6	3
DROP TABLE t1, t2;
#
# Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison
#
CREATE TABLE t1(f1 INT, f2 INT, f3 INT);
INSERT INTO t1 VALUES (1, NULL, 3);
CREATE TABLE t2(f1 INT, f2 INT);
INSERT INTO t2 VALUES (2, 1);
EXPLAIN EXTENDED SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	1	100.00	NULL
1	SIMPLE	t2	system	NULL	NULL	NULL	NULL	1	100.00	NULL
Warnings:
Note	1003	/* select#1 */ select '1' AS `f1`,NULL AS `f2`,'3' AS `f3`,NULL AS `f1`,NULL AS `f2` from `test`.`t2` where ((coalesce('1',NULL),'3') in ((1,3),(2,2)))
SELECT * FROM t1 LEFT JOIN t2 ON t1.f2 = t2.f2
WHERE (COALESCE(t1.f1, t2.f1), f3) IN ((1, 3), (2, 2));
f1	f2	f3	f1	f2
1	NULL	3	NULL	NULL
DROP TABLE t1, t2;
#
# Bug#52357: Assertion failed: join->best_read in greedy_search 
# optimizer_search_depth=0
#
CREATE TABLE t1( a INT );
INSERT INTO t1 VALUES (1),(2);
SET optimizer_search_depth = 0;
# Should not core dump on query preparation
EXPLAIN
SELECT 1
FROM t1 tt3 LEFT  OUTER JOIN t1 tt4 ON 1
LEFT  OUTER JOIN t1 tt5 ON 1
LEFT  OUTER JOIN t1 tt6 ON 1
LEFT  OUTER JOIN t1 tt7 ON 1
LEFT  OUTER JOIN t1 tt8 ON 1
RIGHT OUTER JOIN t1 tt2 ON 1
RIGHT OUTER JOIN t1 tt1 ON 1
STRAIGHT_JOIN    t1 tt9 ON 1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	tt1	ALL	NULL	NULL	NULL	NULL	2	NULL
1	SIMPLE	tt2	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt3	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt4	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt5	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt6	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt7	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt8	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	tt9	ALL	NULL	NULL	NULL	NULL	2	Using join buffer (Block Nested Loop)
SET optimizer_search_depth = DEFAULT;
DROP TABLE t1;
#
# Bug#46091 STRAIGHT_JOIN + RIGHT JOIN returns different result
#
CREATE TABLE t1 (f1 INT NOT NULL);
INSERT INTO t1 VALUES (9),(0);
CREATE TABLE t2 (f1 INT NOT NULL);
INSERT INTO t2 VALUES
(5),(3),(0),(3),(1),(0),(1),(7),(1),(0),(0),(8),(4),(9),(0),(2),(0),(8),(5),(1);
SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
COUNT(*)
476
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	TA2	ALL	NULL	NULL	NULL	NULL	20	Using where
1	SIMPLE	TA3	ALL	NULL	NULL	NULL	NULL	20	Using join buffer (Block Nested Loop)
1	SIMPLE	TA1	ALL	NULL	NULL	NULL	NULL	2	Using where; Using join buffer (Block Nested Loop)
DROP TABLE t1, t2;
#
# Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990
#
CREATE TABLE t1(f1 INT, PRIMARY KEY (f1));
INSERT INTO t1 VALUES (1),(2);
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
LEFT JOIN t1 AS jt2
RIGHT JOIN t1 AS jt3
JOIN t1 AS jt4 ON 1
LEFT JOIN t1 AS jt5 ON 1
ON 1
RIGHT JOIN t1 AS jt6 ON jt6.f1
ON 1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	jt1	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
1	SIMPLE	jt6	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt3	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt4	index	NULL	PRIMARY	4	NULL	2	100.00	Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt5	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt2	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
Warnings:
Note	1003	/* select#1 */ select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt1` left join (`test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1))) on(1) where 1
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN jt1.f1 FROM t1 AS jt1
RIGHT JOIN t1 AS jt2
RIGHT JOIN t1 AS jt3
JOIN t1 AS jt4 ON 1
LEFT JOIN t1 AS jt5 ON 1
ON 1
RIGHT JOIN t1 AS jt6 ON jt6.f1
ON 1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	jt6	index	NULL	PRIMARY	4	NULL	2	100.00	Using index
1	SIMPLE	jt3	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt4	index	NULL	PRIMARY	4	NULL	2	100.00	Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt5	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt2	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
1	SIMPLE	jt1	index	NULL	PRIMARY	4	NULL	2	100.00	Using where; Using index; Using join buffer (Block Nested Loop)
Warnings:
Note	1003	/* select#1 */ select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1
DROP TABLE t1;
#
# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field
#
CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1));
CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2));
INSERT INTO t1 VALUES (4);
INSERT INTO t2 VALUES (3, 3);
INSERT INTO t2 VALUES (7, 7);
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4
GROUP BY t2.f1, t2.f2;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	PRIMARY	NULL	NULL	NULL	1	Using temporary; Using filesort
1	SIMPLE	t2	ref	PRIMARY	PRIMARY	4	const	1	Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4
GROUP BY t2.f1, t2.f2;
f1	f1	f2
4	NULL	NULL
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	system	PRIMARY	NULL	NULL	NULL	1	Using filesort
1	SIMPLE	t2	ref	PRIMARY	PRIMARY	4	const	1	Using where; Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
f1	f1	f2
DROP TABLE t1,t2;
#
# Bug#57034 incorrect OUTER JOIN result when joined on unique key
#
CREATE TABLE t1 (pk INT PRIMARY KEY, 
col_int INT, 
col_int_unique INT UNIQUE KEY);
INSERT INTO t1 VALUES (1,NULL,2), (2,0,0);
CREATE TABLE t2 (pk INT PRIMARY KEY,
col_int INT,
col_int_unique INT UNIQUE KEY);
INSERT INTO t2 VALUES (1,0,1), (2,0,2);
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2
ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int 
WHERE t1.pk=1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	const	PRIMARY	PRIMARY	4	const	1	NULL
1	SIMPLE	t2	const	col_int_unique	col_int_unique	5	const	1	NULL
SELECT * FROM t1 LEFT JOIN t2
ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int 
WHERE t1.pk=1;
pk	col_int	col_int_unique	pk	col_int	col_int_unique
1	NULL	2	NULL	NULL	NULL
DROP TABLE t1,t2;
#
# Bug#48046 Server incorrectly processing JOINs on NULL values
#
CREATE TABLE `BB` (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`time_key` time DEFAULT NULL,
`varchar_key` varchar(1) DEFAULT NULL,
`varchar_nokey` varchar(1) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `time_key` (`time_key`),
KEY `varchar_key` (`varchar_key`)
) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
INSERT INTO `BB` VALUES (10,'18:27:58',NULL,NULL);
SELECT table1.time_key AS field1, table2.pk 
FROM BB table1  LEFT JOIN BB table2 
ON table2.varchar_nokey = table1.varchar_key
HAVING field1;
field1	pk
18:27:58	NULL
DROP TABLE BB;
#
# Bug#49600 Server incorrectly processing RIGHT JOIN with 
#           constant WHERE clause and no index
#
CREATE TABLE `BB` (
`col_datetime_key` datetime DEFAULT NULL,
`col_varchar_key` varchar(1) DEFAULT NULL,
`col_varchar_nokey` varchar(1) DEFAULT NULL,
KEY `col_datetime_key` (`col_datetime_key`),
KEY `col_varchar_key` (`col_varchar_key`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `BB` VALUES ('1900-01-01 00:00:00',NULL,NULL);
SELECT table1.col_datetime_key  
FROM BB table1 RIGHT JOIN BB table2 
ON table2 .col_varchar_nokey = table1.col_varchar_key
WHERE 7;
col_datetime_key
NULL
ALTER TABLE BB DISABLE KEYS;
SELECT table1.col_datetime_key  
FROM BB table1 RIGHT JOIN BB table2
ON table2 .col_varchar_nokey = table1.col_varchar_key
WHERE 7;
col_datetime_key
NULL
DROP TABLE BB;
#
# Bug#58490: Incorrect result in multi level OUTER JOIN
# in combination with IS NULL
#
CREATE TABLE t1 (i INT NOT NULL);
INSERT INTO t1 VALUES (0),    (2),(3),(4);
CREATE TABLE t2 (i INT NOT NULL);
INSERT INTO t2 VALUES (0),(1),    (3),(4);
CREATE TABLE t3 (i INT NOT NULL);
INSERT INTO t3 VALUES (0),(1),(2),    (4);
CREATE TABLE t4 (i INT NOT NULL);
INSERT INTO t4 VALUES (0),(1),(2),(3)   ;
SELECT * FROM
t1 LEFT JOIN
( t2 LEFT JOIN
( t3 LEFT JOIN
t4
ON t4.i = t3.i
)
ON t3.i = t2.i
)
ON t2.i = t1.i
;
i	i	i	i
0	0	0	0
2	NULL	NULL	NULL
3	3	NULL	NULL
4	4	4	NULL
SELECT * FROM
t1 LEFT JOIN
( t2 LEFT JOIN
( t3 LEFT JOIN
t4
ON t4.i = t3.i
)
ON t3.i = t2.i
)
ON t2.i = t1.i
WHERE t4.i IS NULL;
i	i	i	i
2	NULL	NULL	NULL
3	3	NULL	NULL
4	4	4	NULL
SELECT * FROM
t1 LEFT JOIN
( ( t2 LEFT JOIN
t3
ON t3.i = t2.i
)
)
ON t2.i = t1.i
WHERE t3.i IS NULL;
i	i	i
2	NULL	NULL
3	3	NULL
SELECT * FROM
t1 LEFT JOIN
( ( t2 LEFT JOIN
t3
ON t3.i = t2.i
)
JOIN t4
ON t4.i=t2.i
)
ON t2.i = t1.i
WHERE t3.i IS NULL;
i	i	i	i
2	NULL	NULL	NULL
3	3	NULL	3
4	NULL	NULL	NULL
SELECT * FROM
t1 LEFT JOIN
( ( t2 LEFT JOIN
t3
ON t3.i = t2.i
)
JOIN (t4 AS t4a JOIN t4 AS t4b ON t4a.i=t4b.i)
ON t4a.i=t2.i
)
ON t2.i = t1.i
WHERE t3.i IS NULL;
i	i	i	i	i
2	NULL	NULL	NULL	NULL
3	3	NULL	3	3
4	NULL	NULL	NULL	NULL
SELECT * FROM
t1 LEFT JOIN
( ( t2 LEFT JOIN
t3
ON t3.i = t2.i
)
JOIN (t4 AS t4a, t4 AS t4b)
ON t4a.i=t2.i
)
ON t2.i = t1.i
WHERE t3.i IS NULL;
i	i	i	i	i
2	NULL	NULL	NULL	NULL
3	3	NULL	3	0
3	3	NULL	3	1
3	3	NULL	3	2
3	3	NULL	3	3
4	NULL	NULL	NULL	NULL
DROP TABLE t1,t2,t3,t4;
#
# Bug#49322(Duplicate): Server is adding extra NULL row
# on processing a WHERE clause
#
CREATE TABLE h (pk INT NOT NULL, col_int_key INT);
INSERT INTO h VALUES (1,NULL),(4,2),(5,2),(3,4),(2,8);
CREATE TABLE m (pk INT NOT NULL, col_int_key INT);
INSERT INTO m VALUES (1,2),(2,7),(3,5),(4,7),(5,5),(6,NULL),(7,NULL),(8,9);
CREATE TABLE k (pk INT NOT NULL, col_int_key INT);
INSERT INTO k VALUES (1,9),(2,2),(3,5),(4,2),(5,7),(6,0),(7,5);
SELECT TABLE1.pk FROM k TABLE1
RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key;
pk
2
2
4
4
NULL
NULL
NULL
NULL
NULL
NULL
NULL
SELECT TABLE1.pk FROM k TABLE1
RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key
RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key
WHERE TABLE1.pk IS NULL;
pk
NULL
NULL
NULL
NULL
NULL
NULL
NULL
DROP TABLE h,m,k;
#
# Bug #11765810	58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY
# IS EXECUTED TWICE FROM P
#
CREATE TABLE t1 ( a INT ) ENGINE = MYISAM;
INSERT INTO t1 VALUES (1);
PREPARE prep_stmt FROM '
 SELECT 1 AS f FROM t1
 LEFT JOIN t1 t2
  RIGHT JOIN t1 t3
    JOIN t1 t4
   ON 1
  ON 1
 ON 1
 GROUP BY f';
EXECUTE prep_stmt;
f
1
EXECUTE prep_stmt;
f
1
DROP TABLE t1;
End of 5.1 tests
#
# Bug#54235 Extra rows with join_cache_level=4,6,8 and two LEFT JOIN
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
CREATE TABLE t4 (a int);
INSERT INTO t1 VALUES (null),(null);
explain SELECT t1.a FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.a)
ON 0 WHERE t1.a OR t3.a;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	0	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; Using join buffer (Block Nested Loop)
SELECT t1.a FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.a)
ON 0 WHERE t1.a OR t3.a;
a
explain SELECT t1.a FROM t1 LEFT JOIN
(t2 LEFT JOIN (t3 LEFT JOIN t4 ON 1) ON t2.a)
ON 0 WHERE t1.a OR t4.a;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	0	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	0	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	0	Using where; Using join buffer (Block Nested Loop)
SELECT t1.a FROM t1 LEFT JOIN
(t2 LEFT JOIN (t3 LEFT JOIN t4 ON 1) ON t2.a)
ON 0 WHERE t1.a OR t4.a;
a
DROP TABLE t1,t2,t3,t4;
#
# Bug#56254 Assertion tab->ref.use_count fails in
# join_read_key_unlock_row() on 4-way JOIN
#
CREATE TABLE t1 (
pk INT NOT NULL,
col_int_key INT,
col_int INT,
PRIMARY KEY (pk),
KEY col_int_key (col_int_key)
);
INSERT INTO t1 VALUES (6, -448724992, NULL);
CREATE TABLE t2 (
col_int INT,
col_varchar_10 VARCHAR(10)
);
INSERT INTO t2 VALUES (6,'afasdkiyum');
CREATE TABLE t3 (
col_varchar_10 VARCHAR(10),
col_int INT
);
CREATE TABLE t4 (
pk INT NOT NULL,
PRIMARY KEY (pk)
);
INSERT INTO t4 VALUES (1);
INSERT INTO t4 VALUES (2);
SELECT t1.col_int
FROM t1
LEFT JOIN t2
LEFT JOIN t3
JOIN t4  
ON t3.col_int  = t4.pk
ON t2.col_varchar_10 = t3.col_varchar_10
ON t2.col_int = t1.pk
WHERE   t1.col_int_key IS NULL OR t4.pk < t3.col_int;
col_int
DROP TABLE t1,t2,t3,t4;

# BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN
# USED IN GROUP BY

CREATE TABLE t1 (pk int(11));
PREPARE prep_stmt_9846 FROM '
SELECT alias1.pk AS field1 FROM
t1 AS alias1
LEFT JOIN
( 
  t1 AS alias2
  RIGHT  JOIN
  ( 
    t1 AS alias3
    JOIN t1 AS alias4
    ON 1
  )
  ON 1
)
ON 1
GROUP BY field1';
execute prep_stmt_9846;
field1
execute prep_stmt_9846;
field1
deallocate prepare prep_stmt_9846;
drop table t1;
#
# Bug#13040136 - ASSERT IN PLAN_CHANGE_WATCHDOG::~PLAN_CHANGE_WATCHDOG()
#
CREATE TABLE t1 (
col_varchar_10 VARCHAR(10),
col_int_key INTEGER,
col_varchar_10_key VARCHAR(10),
pk INTEGER NOT NULL,
PRIMARY KEY (pk),
KEY (col_int_key),
KEY (col_varchar_10_key)
);
INSERT INTO t1 VALUES ('q',NULL,'o',1);
CREATE TABLE t2 (
pk INTEGER NOT NULL AUTO_INCREMENT,
col_varchar_10_key VARCHAR(10),
col_int_key INTEGER,
col_varchar_10 VARCHAR(10),
PRIMARY KEY (pk),
KEY (col_varchar_10_key),
KEY col_int_key (col_int_key)
);
INSERT INTO t2 VALUES
(1,'r',NULL,'would'),(2,'tell',-655032320,'t'),
(3,'d',9,'a'),(4,'gvafasdkiy',6,'ugvafasdki'),
(5,'that\'s',NULL,'she'),(6,'bwftwugvaf',7,'cbwftwugva'),
(7,'f',-700055552,'mkacbwftwu'),(8,'a',9,'be'),
(9,'d',NULL,'u'),(10,'ckiixcsxmk',NULL,'o');
SELECT DISTINCT t2.col_int_key 
FROM
t1
LEFT JOIN t2
ON t1.col_varchar_10 = t2.col_varchar_10_key 
WHERE t2.pk
ORDER BY t2.col_int_key;
col_int_key
DROP TABLE t1,t2;
#
# Bug#13068506 - QUERY WITH GROUP BY ON NON-AGGR COLUMN RETURNS WRONG RESULT
#
CREATE TABLE t1 (i1 int);
INSERT INTO t1 VALUES (100), (101);
CREATE TABLE t2 (i2 int, i3 int);
INSERT INTO t2 VALUES (20,1),(10,2);
CREATE TABLE t3 (i4 int(11));
INSERT INTO t3 VALUES (1),(2);

SELECT (
SELECT MAX( t2.i2 )
FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
WHERE t2.i3 <> t1.i1
) AS field1
FROM t1;;
field1
20
20

SELECT (
SELECT MAX( t2.i2 )
FROM t3 RIGHT JOIN t2 ON ( t2.i3 = 2 )
WHERE t2.i3 <> t1.i1
) AS field1
FROM t1 GROUP BY field1;;
field1
20

drop table t1,t2,t3;
# Bug#11766384 - 59487: WRONG RESULT WITH STRAIGHT_JOIN AND RIGHT JOIN
CREATE TABLE t1 (
pk int(11) NOT NULL,
col_varchar_10_latin1_key varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,'1');
CREATE TABLE t2 (
pk int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t2 VALUES (1);
CREATE TABLE t3 (
pk int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t3 VALUES (1);
CREATE TABLE t4 (
pk int(11) NOT NULL,
col_int int(11) DEFAULT NULL,
col_int_key int(11) DEFAULT NULL,
col_varchar_10_latin1_key varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t4 VALUES (1,1,1,'1');
CREATE TABLE t5 (
col_int int(11) DEFAULT NULL,
col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t5 VALUES (1,'1');
CREATE TABLE t6 (
col_int_key int(11) DEFAULT NULL,
col_varchar_10_latin1_key varchar(10) DEFAULT NULL,
pk int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t6 VALUES (1,'1',1);
SELECT STRAIGHT_JOIN t6a.pk, t2.pk
FROM
t6 AS t6a
LEFT JOIN
(
t2
RIGHT JOIN
(
(
t1
LEFT JOIN
(
t4
JOIN
t3
ON t4.col_int
)
ON t4.col_int_key = t1.pk
)
LEFT JOIN
(
t5
JOIN
t6 AS t6b
ON t5.col_varchar_10_utf8_key = t6b.col_varchar_10_latin1_key
)
ON t1.pk = t5.col_int
)
ON t4.col_varchar_10_latin1_key = t1.col_varchar_10_latin1_key
AND t5.col_varchar_10_utf8_key = 0
)
ON t6a.pk IS TRUE
WHERE t6b.col_int_key IS TRUE
;
pk	pk
1	NULL
EXPLAIN SELECT STRAIGHT_JOIN t6a.pk, t2.pk
FROM
t6 AS t6a
LEFT JOIN
(
t2
RIGHT JOIN
(
(
t1
LEFT JOIN
(
t4
JOIN
t3
ON t4.col_int
)
ON t4.col_int_key = t1.pk
)
LEFT JOIN
(
t5
JOIN
t6 AS t6b
ON t5.col_varchar_10_utf8_key = t6b.col_varchar_10_latin1_key
)
ON t1.pk = t5.col_int
)
ON t4.col_varchar_10_latin1_key = t1.col_varchar_10_latin1_key
AND t5.col_varchar_10_utf8_key = 0
)
ON t6a.pk IS TRUE
WHERE t6b.col_int_key IS TRUE
;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t6a	ALL	NULL	NULL	NULL	NULL	1	Using where
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	1	Using join buffer (Block Nested Loop)
1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	1	Using join buffer (Block Nested Loop)
1	SIMPLE	t5	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t6b	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
SELECT t6a.pk, t2.pk
FROM
t6 AS t6a
LEFT JOIN
(
t2
RIGHT JOIN
(
(
t1
LEFT JOIN
(
t4
JOIN
t3
ON t4.col_int
)
ON t4.col_int_key = t1.pk
)
LEFT JOIN
(
t5
JOIN
t6 AS t6b
ON t5.col_varchar_10_utf8_key = t6b.col_varchar_10_latin1_key
)
ON t1.pk = t5.col_int
)
ON t4.col_varchar_10_latin1_key = t1.col_varchar_10_latin1_key
AND t5.col_varchar_10_utf8_key = 0
)
ON t6a.pk IS TRUE
WHERE t6b.col_int_key IS TRUE
;
pk	pk
1	NULL
EXPLAIN SELECT t6a.pk, t2.pk
FROM
t6 AS t6a
LEFT JOIN
(
t2
RIGHT JOIN
(
(
t1
LEFT JOIN
(
t4
JOIN
t3
ON t4.col_int
)
ON t4.col_int_key = t1.pk
)
LEFT JOIN
(
t5
JOIN
t6 AS t6b
ON t5.col_varchar_10_utf8_key = t6b.col_varchar_10_latin1_key
)
ON t1.pk = t5.col_int
)
ON t4.col_varchar_10_latin1_key = t1.col_varchar_10_latin1_key
AND t5.col_varchar_10_utf8_key = 0
)
ON t6a.pk IS TRUE
WHERE t6b.col_int_key IS TRUE
;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t6a	ALL	NULL	NULL	NULL	NULL	1	Using where
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	1	Using join buffer (Block Nested Loop)
1	SIMPLE	t4	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t3	ALL	NULL	NULL	NULL	NULL	1	Using join buffer (Block Nested Loop)
1	SIMPLE	t5	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
1	SIMPLE	t6b	ALL	NULL	NULL	NULL	NULL	1	Using where; Using join buffer (Block Nested Loop)
drop table t1,t2,t3,t4,t5,t6;
#
# Verify that the "not exists" optimization works.
#
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT NOT NULL);
INSERT INTO t1 VALUES(1),(2);
INSERT INTO t2 VALUES(1),(2);
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.a IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	NULL
1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where; Not exists; Using join buffer (Block Nested Loop)
FLUSH STATUS;
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.a IS NULL;
a	a
SHOW STATUS LIKE 'HANDLER_READ%';
Variable_name	Value
Handler_read_first	0
Handler_read_key	0
Handler_read_last	0
Handler_read_next	0
Handler_read_prev	0
Handler_read_rnd	0
Handler_read_rnd_next	6
DROP TABLE t1,t2;
#
# Bug#13464334 SAME QUERY PRODUCES DIFFERENT RESULTS WHEN USED WITH AND
# WITHOUT UNION ALL
#
CREATE TABLE t1 (p1 INT PRIMARY KEY, a CHAR(1));
CREATE TABLE t2 (p2 INT PRIMARY KEY, b CHAR(1));
INSERT INTO t1 VALUES (1,'a'),(2,'b'),(3,'c');
INSERT INTO t2 VALUES (1,'h'),(2,'i'),(3,'j'),(4,'k');
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v2 AS SELECT * FROM t2;
(SELECT p1 FROM v2 LEFT JOIN v1 ON b = a WHERE p2 = 1 GROUP BY p1 ORDER BY p1)
UNION (SELECT NULL LIMIT 0);
p1
NULL
DROP VIEW v1, v2;
DROP TABLE t1, t2;
#
# Bug#13980954 Missing data on left join + null value + where..in
#
CREATE TABLE t1 (ik INT, vc varchar(1)) ENGINE=Innodb;
explain format=json SELECT straight_join t1.vc, t1.ik
FROM t1 JOIN t1 AS t2 ON t1.vc=t2.vc LEFT JOIN t1 AS t3 ON t1.vc=t3.vc;
EXPLAIN
{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "t1",
          "access_type": "ALL",
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "t2",
          "access_type": "ALL",
          "rows": 1,
          "filtered": 100,
          "using_join_buffer": "Block Nested Loop",
          "attached_condition": "(`test`.`t2`.`vc` = `test`.`t1`.`vc`)"
        }
      },
      {
        "table": {
          "table_name": "t3",
          "access_type": "ALL",
          "rows": 1,
          "filtered": 100,
          "using_join_buffer": "Block Nested Loop",
          "attached_condition": "<if>(is_not_null_compl(t3), (`test`.`t3`.`vc` = `test`.`t1`.`vc`), true)"
        }
      }
    ]
  }
}
Warnings:
Note	1003	/* select#1 */ select straight_join `test`.`t1`.`vc` AS `vc`,`test`.`t1`.`ik` AS `ik` from `test`.`t1` join `test`.`t1` `t2` left join `test`.`t1` `t3` on((`test`.`t3`.`vc` = `test`.`t1`.`vc`)) where (`test`.`t2`.`vc` = `test`.`t1`.`vc`)
SELECT straight_join t1.vc, t1.ik
FROM t1 JOIN t1 AS t2 ON t1.vc=t2.vc LEFT JOIN t1 AS t3 ON t1.vc=t3.vc;
vc	ik
DROP TABLE t1;
set optimizer_switch=default;

Filemanager

Name Type Size Permission Actions
1st.result File 483 B 0644
alias.result File 13.42 KB 0644
almost_full.result File 1.11 KB 0644
alter_table-big.result File 3.12 KB 0644
alter_table.result File 108.41 KB 0644
analyze.result File 2.21 KB 0644
ansi.result File 1.14 KB 0644
archive-big.result File 616 B 0644
archive.result File 525.38 KB 0644
archive_bitfield.result File 4.26 KB 0644
archive_debug.result File 355 B 0644
archive_gis.result File 23.13 KB 0644
archive_no_symlink.result File 882 B 0644
archive_plugin.result File 543 B 0644
archive_symlink.result File 2.07 KB 0644
audit_plugin.result File 744 B 0644
auth_rpl.result File 1.85 KB 0644
auto_increment.result File 11.72 KB 0644
backup.result File 4.29 KB 0644
bench_count_distinct.result File 462 B 0644
big_test.require File 17 B 0644
bigint.result File 20.72 KB 0644
binary.result File 5.67 KB 0644
binary_to_hex.result File 5.87 KB 0644
binlog_tx_isolation.result File 1.71 KB 0644
blackhole.result File 613 B 0644
blackhole_plugin.result File 571 B 0644
bool.result File 2.56 KB 0644
bootstrap.result File 267 B 0644
bug12427262.result File 1.86 KB 0644
bug12969156.result File 952 B 0644
bug17076131.result File 322 B 0644
bug33509.result File 2.31 KB 0644
bug39022.result File 1.2 KB 0644
bug46080.result File 669 B 0644
bug46261.result File 382 B 0644
bug46760.result File 1.26 KB 0644
bug47671.result File 287 B 0644
bug58669.result File 480 B 0644
bulk_replace.result File 281 B 0644
cache_innodb.result File 5.42 KB 0644
case.result File 10.06 KB 0644
case_insensitive_file_system.require File 46 B 0644
case_sensitive_file_system.require File 47 B 0644
cast.result File 15.75 KB 0644
change_user.result File 3.31 KB 0644
check.result File 1.42 KB 0644
check_auto_permission.result File 251 B 0644
check_var_limit.require File 8 B 0644
client_xml.result File 2.38 KB 0644
comment_column.result File 140.57 KB 0644
comment_column2.result File 355.68 KB 0644
comment_index.result File 173.03 KB 0644
comment_table.result File 28.72 KB 0644
comments.result File 2.34 KB 0644
commit.result File 13.32 KB 0644
commit_1innodb.result File 19.19 KB 0644
compare.result File 3.17 KB 0644
compress.result File 56.5 KB 0644
concurrent_innodb_safelog.result File 31.89 KB 0644
concurrent_innodb_unsafelog.result File 31.61 KB 0644
connect.result File 12.75 KB 0644
connect_debug.result File 1.48 KB 0644
consistent_snapshot.result File 1.14 KB 0644
constraints.result File 2.55 KB 0644
count_distinct.result File 7.89 KB 0644
count_distinct2.result File 2.21 KB 0644
count_distinct3.result File 278 B 0644
create-big.result File 7.6 KB 0644
create.result File 147.09 KB 0644
create_not_windows.result File 961 B 0644
create_select_tmp.result File 846 B 0644
csv.result File 58.88 KB 0644
csv_alter_table.result File 1.17 KB 0644
csv_not_null.result File 1.75 KB 0644
ctype_ascii.result File 2.11 KB 0644
ctype_big5.result File 33.85 KB 0644
ctype_binary.result File 82.34 KB 0644
ctype_collate.result File 13.5 KB 0644
ctype_cp1250_ch.result File 21.88 KB 0644
ctype_cp1251.result File 96.09 KB 0644
ctype_cp932.result File 996 B 0644
ctype_cp932_binlog_row.result File 607 B 0644
ctype_cp932_binlog_stm.result File 251.22 KB 0644
ctype_create.result File 3.12 KB 0644
ctype_errors.result File 1.66 KB 0644
ctype_eucjpms.result File 400.21 KB 0644
ctype_euckr.result File 434.59 KB 0644
ctype_filename.result File 324 B 0644
ctype_filesystem.result File 341 B 0644
ctype_gb2312.result File 33.29 KB 0644
ctype_gbk.result File 49.63 KB 0644
ctype_gbk_binlog.result File 647 B 0644
ctype_hebrew.result File 254 B 0644
ctype_latin1.result File 118.67 KB 0644
ctype_latin1_de.result File 15.74 KB 0644
ctype_latin2.result File 13.32 KB 0644
ctype_latin2_ch.result File 25.11 KB 0644
ctype_ldml.result File 28.05 KB 0644
ctype_like_range.result File 80.89 KB 0644
ctype_many.result File 42.67 KB 0644
ctype_mb.result File 2.13 KB 0644
ctype_recoding.result File 9.6 KB 0644
ctype_sjis.result File 195.68 KB 0644
ctype_tis620.result File 100.45 KB 0644
ctype_uca.result File 154.97 KB 0644
ctype_ucs.result File 142.4 KB 0644
ctype_ucs2_def.result File 1.05 KB 0644
ctype_ujis.result File 364.9 KB 0644
ctype_ujis_ucs2.result File 548.59 KB 0644
ctype_utf16.result File 44.96 KB 0644
ctype_utf16_def.result File 273 B 0644
ctype_utf16_uca.result File 72.28 KB 0644
ctype_utf16le.result File 50.54 KB 0644
ctype_utf32.result File 48.05 KB 0644
ctype_utf32_uca.result File 75.11 KB 0644
ctype_utf8.result File 167.06 KB 0644
ctype_utf8mb4.result File 80.38 KB 0644
ctype_utf8mb4_heap.result File 72.21 KB 0644
ctype_utf8mb4_innodb.result File 74.62 KB 0644
ctype_utf8mb4_myisam.result File 74.63 KB 0644
ctype_utf8mb4_uca.result File 38.82 KB 0644
date_formats.result File 24.96 KB 0644
ddl_i18n_koi8r.result File 113.33 KB 0644
ddl_i18n_utf8.result File 116.35 KB 0644
deadlock_innodb.result File 2.35 KB 0644
debug_sync.result File 11.85 KB 0644
debug_sync2.result File 434 B 0644
default.result File 8.02 KB 0644
delayed.result File 17.7 KB 0644
delete.result File 16 KB 0644
deprecated_features.result File 2.03 KB 0644
derived.result File 78.6 KB 0644
dirty_close.result File 345 B 0644
disabled_replication.result File 3.01 KB 0644
disconnect_on_expired_password_default.result File 1.4 KB 0644
disconnect_on_expired_password_off.result File 1.36 KB 0644
distinct.result File 30.85 KB 0644
drop-no_root.result File 454 B 0644
drop.result File 5.73 KB 0644
drop_debug.result File 485 B 0644
ds_mrr-big.result File 2.14 KB 0644
dynamic_tracing.result File 813 B 0644
empty_table.result File 229 B 0644
enable_cleartext_plugin.result File 1.35 KB 0644
endspace.result File 6.61 KB 0644
eq_range_idx_stat.result File 4.02 KB 0644
error_simulation.result File 3.23 KB 0644
errors.result File 5.93 KB 0644
events_1.result File 22.18 KB 0644
events_2.result File 17.23 KB 0644
events_bugs.result File 37.35 KB 0644
events_embedded.result File 86 B 0644
events_grant.result File 10.33 KB 0644
events_logs_tests.result File 2.37 KB 0644
events_microsec.result File 810 B 0644
events_restart.result File 4.15 KB 0644
events_scheduling.result File 3.11 KB 0644
events_stress.result File 2.39 KB 0644
events_time_zone.result File 5.4 KB 0644
events_trans.result File 3.49 KB 0644
events_trans_notembedded.result File 1.37 KB 0644
execution_constants.result File 1.05 KB 0644
explain.result File 28.33 KB 0644
explain_json_all.result File 63.13 KB 0644
explain_json_none.result File 64.7 KB 0644
file_contents.result File 181 B 0644
filesort_debug.result File 2.79 KB 0644
fix_priv_tables.result File 1.3 KB 0644
flush.result File 13.75 KB 0644
flush2.result File 882 B 0644
flush_block_commit.result File 1.47 KB 0644
flush_block_commit_notembedded.result File 770 B 0644
flush_read_lock.result File 72.07 KB 0644
flush_read_lock_kill.result File 1.12 KB 0644
flush_table.result File 11.22 KB 0644
foreign_key.result File 3.33 KB 0644
fulltext.result File 28.72 KB 0644
fulltext2.result File 7.54 KB 0644
fulltext3.result File 540 B 0644
fulltext_cache.result File 2.67 KB 0644
fulltext_distinct.result File 1.25 KB 0644
fulltext_left_join.result File 4 KB 0644
fulltext_multi.result File 766 B 0644
fulltext_order_by.result File 5.83 KB 0644
fulltext_plugin.result File 229 B 0644
fulltext_update.result File 930 B 0644
fulltext_var.result File 1.3 KB 0644
func_aes.result File 12.78 KB 0644
func_aes_cfb1.result File 4.5 KB 0644
func_aes_cfb128.result File 4.57 KB 0644
func_aes_cfb8.result File 4.5 KB 0644
func_aes_misc.result File 8.28 KB 0644
func_aes_ofb.result File 4.47 KB 0644
func_analyse.result File 19.01 KB 0644
func_compress.result File 4.84 KB 0644
func_concat.result File 4.03 KB 0644
func_crypt.result File 4.37 KB 0644
func_date_add.result File 3.62 KB 0644
func_default.result File 1.19 KB 0644
func_des_encrypt.result File 1018 B 0644
func_digest.result File 121.48 KB 0644
func_encrypt.result File 10.33 KB 0644
func_encrypt_nossl.result File 4.21 KB 0644
func_encrypt_ucs2.result File 765 B 0644
func_equal.result File 1.27 KB 0644
func_gconcat.result File 48.53 KB 0644
func_group.result File 54.64 KB 0644
func_group_innodb.result File 5.12 KB 0644
func_group_innodb_16k.result File 544 B 0644
func_if.result File 6.05 KB 0644
func_in_all.result File 27.62 KB 0644
func_in_icp.result File 27.26 KB 0644
func_in_icp_mrr.result File 27.57 KB 0644
func_in_mrr.result File 27.29 KB 0644
func_in_mrr_cost.result File 27.01 KB 0644
func_in_none.result File 26.96 KB 0644
func_isnull.result File 827 B 0644
func_like.result File 4.45 KB 0644
func_math.result File 28.06 KB 0644
func_misc.result File 28.2 KB 0644
func_op.result File 1.93 KB 0644
func_regexp.result File 4.37 KB 0644
func_rollback.result File 12.44 KB 0644
func_sapdb.result File 12.38 KB 0644
func_set.result File 8.51 KB 0644
func_str.result File 157.75 KB 0644
func_str_debug.result File 349 B 0644
func_str_no_ps.result File 1.07 KB 0644
func_system.result File 2.63 KB 0644
func_test.result File 13.44 KB 0644
func_time.result File 67.37 KB 0644
func_timestamp.result File 518 B 0644
func_weight_string.result File 3.44 KB 0644
function_defaults.result File 109.23 KB 0644
function_defaults_notembedded.result File 6.38 KB 0644
gcc296.result File 528 B 0644
get_diagnostics.result File 24.96 KB 0644
gis-debug.result File 16.13 KB 0644
gis-precise.result File 28.34 KB 0644
gis-rt-precise.result File 1.86 KB 0644
gis-rtree.result File 78.36 KB 0644
gis.result File 58.53 KB 0644
grant.result File 95.95 KB 0644
grant2.result File 31.12 KB 0644
grant3.result File 7.15 KB 0644
grant4.result File 8.85 KB 0644
grant_cache.result File 5.62 KB 0644
grant_explain_non_select.result File 9.5 KB 0644
grant_lowercase_fs.result File 557 B 0644
greedy_optimizer.result File 592.8 KB 0644
greedy_search.result File 12.42 KB 0644
group_by.result File 84.6 KB 0644
group_min_max.result File 115.33 KB 0644
group_min_max_innodb.result File 17.52 KB 0644
handler_innodb.result File 40.72 KB 0644
handler_myisam.result File 44.62 KB 0644
handler_read_last.result File 1.15 KB 0644
have_big5.require File 79 B 0644
have_binlog_format_mixed.require File 40 B 0644
have_binlog_format_row.require File 38 B 0644
have_binlog_format_statement.require File 44 B 0644
have_binlog_rows_query.require File 53 B 0644
have_compress.require File 38 B 0644
have_cp1250_ch.require File 79 B 0644
have_cp1251.require File 84 B 0644
have_cp866.require File 82 B 0644
have_cp932.require File 83 B 0644
have_crypt.require File 35 B 0644
have_debug.require File 8 B 0644
have_debug_sync.require File 13 B 0644
have_eucjpms.require File 87 B 0644
have_euckr.require File 81 B 0644
have_gb2312.require File 84 B 0644
have_gbk.require File 78 B 0644
have_geometry.require File 38 B 0644
have_koi8r.require File 81 B 0644
have_latin2_ch.require File 78 B 0644
have_local_infile.require File 36 B 0644
have_log_bin.require File 31 B 0644
have_met_timezone.require File 43 B 0644
have_moscow_leap_timezone.require File 46 B 0644
have_mysql_upgrade.result File 21 B 0644
have_ndb_extra.require File 14 B 0644
have_ndbapi_examples.require File 19 B 0644
have_nodebug.require File 8 B 0644
have_optimizer_switch.require File 19 B 0644
have_outfile.require File 55 B 0644
have_partition.require File 42 B 0644
have_perror.require File 14 B 0644
have_profiling.require File 39 B 0644
have_query_cache.require File 41 B 0644
have_sjis.require File 81 B 0644
have_ssl.require File 33 B 0644
have_ssl_is_yes_or_disabled_only.require File 43 B 0644
have_symlink.require File 37 B 0644
have_tis620.require File 81 B 0644
have_ucs2.require File 80 B 0644
have_ujis.require File 81 B 0644
have_utf16.require File 82 B 0644
have_utf32.require File 82 B 0644
have_utf8.require File 80 B 0644
have_utf8mb4.require File 86 B 0644
having.result File 19.72 KB 0644
heap.result File 20.86 KB 0644
heap_auto_increment.result File 894 B 0644
heap_btree.result File 9.32 KB 0644
heap_hash.result File 14.37 KB 0644
help.result File 6.46 KB 0644
host_cache_size_functionality.result File 3.32 KB 0644
implicit_char_to_num_conversion.result File 6.44 KB 0644
implicit_commit.result File 17.71 KB 0644
import_schema_mismatch.result File 538 B 0644
index_merge_delete.result File 25.88 KB 0644
index_merge_innodb.result File 61.63 KB 0644
index_merge_insert-and-replace.result File 12.55 KB 0644
index_merge_intersect_dml.result File 4.96 KB 0644
index_merge_myisam.result File 73.48 KB 0644
index_merge_update.result File 16.41 KB 0644
information_schema-big.result File 2.81 KB 0644
information_schema.result File 87.98 KB 0644
information_schema_chmod.result File 182 B 0644
information_schema_db.result File 9.29 KB 0644
information_schema_inno.result File 4.33 KB 0644
information_schema_parameters.result File 22.11 KB 0644
information_schema_part.result File 9.71 KB 0644
information_schema_routines.result File 28.64 KB 0644
init_connect.result File 2.53 KB 0644
init_file.result File 323 B 0644
innodb_explain_json_non_select_all.result File 220.92 KB 0644
innodb_explain_json_non_select_none.result File 225.15 KB 0644
innodb_explain_non_select_all.result File 119.15 KB 0644
innodb_explain_non_select_none.result File 119.03 KB 0644
innodb_icp.result File 26.73 KB 0644
innodb_icp_all.result File 26.79 KB 0644
innodb_icp_none.result File 26.63 KB 0644
innodb_ignore_builtin.result File 354 B 0644
innodb_log_file_size_functionality.result File 2.79 KB 0644
innodb_mrr.result File 20.3 KB 0644
innodb_mrr_all.result File 20.47 KB 0644
innodb_mrr_cost.result File 20.27 KB 0644
innodb_mrr_cost_all.result File 20.43 KB 0644
innodb_mrr_cost_icp.result File 20.38 KB 0644
innodb_mrr_icp.result File 20.41 KB 0644
innodb_mrr_none.result File 20.22 KB 0644
innodb_mysql_lock.result File 5.52 KB 0644
innodb_mysql_lock2.result File 21.27 KB 0644
innodb_mysql_sync.result File 17.65 KB 0644
innodb_pk_extension_off.result File 14.06 KB 0644
innodb_pk_extension_on.result File 14.33 KB 0644
innodb_recovery_with_upper_case_names.result File 1.21 KB 0644
insert.result File 26.41 KB 0644
insert_debug.result File 1.29 KB 0644
insert_notembedded.result File 5.72 KB 0644
insert_select.result File 14.04 KB 0644
insert_update.result File 9.64 KB 0644
ipv4_as_ipv6.result File 21.69 KB 0644
ipv6.result File 12.49 KB 0644
is_debug_build.require File 32 B 0644
is_embedded.require File 16 B 0644
isam.result File 15.65 KB 0644
join.result File 46.84 KB 0644
join_cache_bka.result File 88.08 KB 0644
join_cache_bka_nixbnl.result File 87.38 KB 0644
join_cache_bkaunique.result File 88.54 KB 0644
join_cache_bnl.result File 86.26 KB 0644
join_cache_nojb.result File 85.38 KB 0644
join_crash.result File 4.59 KB 0644
join_nested.result File 62.76 KB 0644
join_nested_bka.result File 66.92 KB 0644
join_nested_bka_nixbnl.result File 63.95 KB 0644
join_optimizer.result File 2.54 KB 0644
join_outer.result File 63.99 KB 0644
join_outer_bka.result File 64.28 KB 0644
join_outer_bka_nixbnl.result File 62.57 KB 0644
join_outer_innodb.result File 1.86 KB 0644
key.result File 20.98 KB 0644
key_cache.result File 10.91 KB 0644
key_diff.result File 853 B 0644
key_primary.result File 666 B 0644
keywords.result File 6.63 KB 0644
kill.result File 8.37 KB 0644
kill_debug.result File 1.56 KB 0644
limit.result File 4.12 KB 0644
loaddata.result File 16.91 KB 0644
loaddata_autocom_innodb.result File 637 B 0644
loadxml.result File 2.71 KB 0644
locale.result File 5.59 KB 0644
lock.result File 15.03 KB 0644
lock_multi.result File 11.53 KB 0644
lock_multi_bug38499.result File 691 B 0644
lock_multi_bug38691.result File 539 B 0644
lock_sync.result File 31.17 KB 0644
lock_tables_lost_commit.result File 150 B 0644
log_empty_name.result File 247 B 0644
log_errchk.result File 664 B 0644
log_state.result File 9.66 KB 0644
log_state_bug33693.result File 111 B 0644
log_tables-big.result File 996 B 0644
log_tables.result File 40.97 KB 0644
log_tables_debug.result File 838 B 0644
log_tables_upgrade.result File 2.48 KB 0644
long_tmpdir.result File 99 B 0644
lowercase0.require File 45 B 0644
lowercase1.require File 45 B 0644
lowercase2.require File 45 B 0644
lowercase_fs_off.result File 2.05 KB 0644
lowercase_fs_on.result File 75 B 0644
lowercase_mixed_tmpdir.result File 176 B 0644
lowercase_mixed_tmpdir_innodb.result File 190 B 0644
lowercase_table.result File 2.67 KB 0644
lowercase_table2.result File 8.66 KB 0644
lowercase_table4.result File 3.68 KB 0644
lowercase_table_grant.result File 1.5 KB 0644
lowercase_table_qcache.result File 649 B 0644
lowercase_utf8.result File 173 B 0644
lowercase_view.result File 10.22 KB 0644
mdl_sync.result File 89.85 KB 0644
merge-big.result File 728 B 0644
merge.result File 97.6 KB 0644
merge_innodb.result File 1.31 KB 0644
merge_mmap.result File 3.33 KB 0644
metadata.result File 13.88 KB 0644
mix2_myisam.result File 57.76 KB 0644
mix2_myisam_ucs2.result File 15.31 KB 0644
multi_plugin_load.result File 347 B 0644
multi_plugin_load_add.result File 455 B 0644
multi_plugin_load_add2.result File 455 B 0644
multi_statement.result File 563 B 0644
multi_update.result File 23.21 KB 0644
multi_update2.result File 1016 B 0644
multi_update_innodb.result File 2.56 KB 0644
multi_update_tiny_hash.result File 1.5 KB 0644
myisam-blob.result File 1.25 KB 0644
myisam-system.result File 391 B 0644
myisam.result File 90.78 KB 0644
myisam_crash_before_flush_keys.result File 1.15 KB 0644
myisam_debug.result File 1.21 KB 0644
myisam_explain_json_non_select_all.result File 217.3 KB 0644
myisam_explain_json_non_select_none.result File 221.32 KB 0644
myisam_explain_non_select_all.result File 116.26 KB 0644
myisam_explain_non_select_none.result File 115.98 KB 0644
myisam_icp.result File 26.57 KB 0644
myisam_icp_all.result File 26.63 KB 0644
myisam_icp_none.result File 26.45 KB 0644
myisam_mrr.result File 19.24 KB 0644
myisam_mrr_all.result File 19.44 KB 0644
myisam_mrr_cost.result File 19.19 KB 0644
myisam_mrr_cost_all.result File 19.39 KB 0644
myisam_mrr_cost_icp.result File 19.33 KB 0644
myisam_mrr_icp.result File 19.38 KB 0644
myisam_mrr_none.result File 19.14 KB 0644
myisam_recover.result File 4.57 KB 0644
myisam_row_rpl.result File 2.04 KB 0644
myisampack.result File 7.56 KB 0644
mysql-bug41486.result File 465 B 0644
mysql-bug45236.result File 329 B 0644
mysql.result File 8.67 KB 0644
mysql_binary_mode.result File 1.52 KB 0644
mysql_client_test.result File 8.92 KB 0644
mysql_client_test_embedded.result File 111 B 0644
mysql_client_test_qcache.result File 502 B 0644
mysql_comments.result File 5.02 KB 0644
mysql_config_editor.result File 6.6 KB 0644
mysql_cp932.result File 37 B 0644
mysql_embedded.result File 171 B 0644
mysql_embedded_client_test.result File 153 B 0644
mysql_locale_posix.result File 973 B 0644
mysql_not_windows.result File 80 B 0644
mysql_plugin.result File 3.88 KB 0644
mysql_protocols.result File 208 B 0644
mysql_upgrade.result File 26.82 KB 0644
mysql_upgrade_ssl.result File 1.99 KB 0644
mysqladmin.result File 872 B 0644
mysqladmin_shutdown.result File 157 B 0644
mysqlbinlog.result File 30.17 KB 0644
mysqlbinlog_debug.result File 235 B 0644
mysqlbinlog_mixed_or_statment.result File 855 B 0644
mysqlbinlog_raw_mode.result File 8.32 KB 0644
mysqlbinlog_raw_mode_win.result File 8.08 KB 0644
mysqlbinlog_row_big.result File 2.42 KB 0644
mysqlcheck.result File 15.2 KB 0644
mysqld--defaults-file.result File 710 B 0644
mysqld--help-notwin.result File 53.91 KB 0644
mysqld--help-win.result File 54.47 KB 0644
mysqldump-compat.result File 111 B 0644
mysqldump-max.result File 10.95 KB 0644
mysqldump-no-binlog.result File 50 B 0644
mysqldump.result File 280.61 KB 0644
mysqldump_restore.result File 3.78 KB 0644
mysqlhotcopy_archive.result File 1.8 KB 0644
mysqlhotcopy_myisam.result File 2.28 KB 0644
mysqlimport.result File 490 B 0644
mysqlshow.result File 7.56 KB 0644
mysqlslap.result File 6.88 KB 0644
mysqltest.result File 31.15 KB 0644
named_pipe.result File 56.25 KB 0644
ndb_default_cluster.require File 51 B 0644
negation_elimination.result File 8.72 KB 0644
no-threads.result File 329 B 0644
no_binlog.result File 64 B 0644
not_embedded.require File 16 B 0644
not_embedded_server.result File 5.63 KB 0644
not_ndb.require File 39 B 0644
not_openssl.require File 36 B 0644
not_partition.result File 4.14 KB 0644
not_ssl.require File 32 B 0644
not_true.require File 10 B 0644
not_valgrind.require File 17 B 0644
not_windows.require File 7 B 0644
null.result File 14.48 KB 0644
null_key_all.result File 15.6 KB 0644
null_key_icp.result File 15.53 KB 0644
null_key_none.result File 15.47 KB 0644
odbc.result File 954 B 0644
olap.result File 19.13 KB 0644
one_thread_per_connection.require File 44 B 0644
openssl.require File 37 B 0644
openssl_1.result File 8.04 KB 0644
optimizer_bug12837084.result File 13.97 KB 0644
optimizer_debug_sync.result File 1.32 KB 0644
optimizer_switch.result File 19.94 KB 0644
order_by_all.result File 61.42 KB 0644
order_by_icp_mrr.result File 61.37 KB 0644
order_by_none.result File 61.15 KB 0644
order_by_sortkey.result File 2.91 KB 0644
order_fill_sortbuf.result File 262 B 0644
outfile.result File 2.09 KB 0644
outfile_loaddata.result File 10.12 KB 0644
overflow.result File 235 B 0644
packet.result File 5 KB 0644
parser.result File 38.22 KB 0644
parser_bug21114_innodb.result File 25.39 KB 0644
parser_not_embedded.result File 4.42 KB 0644
parser_precedence.result File 23.96 KB 0644
parser_stack.result File 9.54 KB 0644
partition.result File 76.63 KB 0644
partition_archive.result File 4.51 KB 0644
partition_binlog.result File 2.3 KB 0644
partition_binlog_stmt.result File 442 B 0644
partition_blackhole.result File 174 B 0644
partition_bug18198.result File 8.07 KB 0644
partition_cache.result File 5.16 KB 0644
partition_charset.result File 434 B 0644
partition_column.result File 23.07 KB 0644
partition_column_prune.result File 2.83 KB 0644
partition_csv.result File 1.83 KB 0644
partition_datatype.result File 39.34 KB 0644
partition_debug_sync.result File 3.19 KB 0644
partition_disabled.result File 4.59 KB 0644
partition_error.result File 82.17 KB 0644
partition_exchange.result File 37.6 KB 0644
partition_explicit_prune.result File 55.63 KB 0644
partition_federated.result File 271 B 0644
partition_grant.result File 1.54 KB 0644
partition_hash.result File 7.12 KB 0644
partition_index_innodb.result File 4.04 KB 0644
partition_index_myisam.result File 3.21 KB 0644
partition_innodb.result File 30.66 KB 0644
partition_innodb_plugin.result File 5.26 KB 0644
partition_innodb_semi_consistent.result File 2.92 KB 0644
partition_innodb_stmt.result File 1.12 KB 0644
partition_innodb_tablespace.result File 12.76 KB 0644
partition_key_cache.result File 16.74 KB 0644
partition_list.result File 12.92 KB 0644
partition_locking.result File 238.13 KB 0644
partition_locking_4.result File 1.7 KB 0644
partition_mgm.result File 4.7 KB 0644
partition_mgm_err.result File 7.48 KB 0644
partition_mgm_err2.result File 43 B 0644
partition_myisam.result File 7.67 KB 0644
partition_not_blackhole.result File 456 B 0644
partition_not_windows.result File 3.47 KB 0644
partition_open_files_limit.result File 1.02 KB 0644
partition_order.result File 16.29 KB 0644
partition_pruning.result File 166.97 KB 0644
partition_range.result File 33.91 KB 0644
partition_rename_longfilename.result File 2.89 KB 0644
partition_symlink.result File 4.89 KB 0644
partition_sync.result File 1.34 KB 0644
partition_truncate.result File 751 B 0644
partition_utf8.result File 2 KB 0644
partition_windows.result File 1.18 KB 0644
perror-win.result File 453 B 0644
perror.result File 471 B 0644
plugin.result File 7.73 KB 0644
plugin_auth.result File 23.39 KB 0644
plugin_auth_qa.result File 20.77 KB 0644
plugin_auth_qa_1.result File 13.74 KB 0644
plugin_auth_qa_2.result File 8.87 KB 0644
plugin_auth_qa_3.result File 1.14 KB 0644
plugin_auth_sha256.result File 3.97 KB 0644
plugin_auth_sha256_2.result File 1.49 KB 0644
plugin_auth_sha256_server_default.result File 2.7 KB 0644
plugin_auth_sha256_server_default_tls.result File 2.83 KB 0644
plugin_auth_sha256_tls.result File 1.82 KB 0644
plugin_load.result File 76 B 0644
plugin_load_option.result File 321 B 0644
plugin_not_embedded.result File 474 B 0644
preload.result File 3.84 KB 0644
profiling.result File 16.13 KB 0644
ps.result File 116.73 KB 0644
ps_10nestset.result File 2.08 KB 0644
ps_11bugs.result File 5.92 KB 0644
ps_1general.result File 35.91 KB 0644
ps_2myisam.result File 103.82 KB 0644
ps_3innodb.result File 103.36 KB 0644
ps_4heap.result File 103.28 KB 0644
ps_5merge.result File 202.34 KB 0644
ps_ddl.result File 53.68 KB 0644
ps_ddl1.result File 11.06 KB 0644
ps_grant.result File 3.71 KB 0644
ps_not_windows.result File 516 B 0644
python_with_json.require File 27 B 0644
query_cache.result File 75.57 KB 0644
query_cache_28249.result File 2.29 KB 0644
query_cache_debug.result File 8.63 KB 0644
query_cache_disabled.result File 639 B 0644
query_cache_merge.result File 32.41 KB 0644
query_cache_notembedded.result File 6.61 KB 0644
query_cache_ps_no_prot.result File 11.1 KB 0644
query_cache_ps_ps_prot.result File 11.09 KB 0644
query_cache_size_functionality.result File 6.64 KB 0644
query_cache_type_functionality.result File 6.79 KB 0644
query_cache_with_views.result File 4.96 KB 0644
range_all.result File 81.48 KB 0644
range_icp.result File 81.08 KB 0644
range_icp_mrr.result File 81.42 KB 0644
range_mrr.result File 80.98 KB 0644
range_mrr_cost.result File 80.67 KB 0644
range_none.result File 80.63 KB 0644
read_many_rows_innodb.result File 2.83 KB 0644
read_only.result File 6.3 KB 0644
read_only_innodb.result File 4.76 KB 0644
rename.result File 1.58 KB 0644
renamedb.result File 880 B 0644
repair.result File 7.02 KB 0644
replace.result File 1.09 KB 0644
rewrite_general_log.result File 8.33 KB 0644
rewrite_slow_log.result File 2.92 KB 0644
rollback.result File 582 B 0644
round.result File 6.74 KB 0644
row.result File 15.91 KB 0644
rowid_order_innodb.result File 3.32 KB 0644
rpl_colSize.result File 4.39 KB 0644
rpl_extraColmaster_innodb.result File 23.85 KB 0644
rpl_extraColmaster_myisam.result File 23.85 KB 0644
rpl_mysqldump_slave.result File 867 B 0644
schema.result File 2.37 KB 0644
secure_file_priv_win.result File 1.43 KB 0644
select_all.result File 150.09 KB 0644
select_all_bka.result File 150.86 KB 0644
select_all_bka_nixbnl.result File 150.11 KB 0644
select_found.result File 6.17 KB 0644
select_icp_mrr.result File 150.04 KB 0644
select_icp_mrr_bka.result File 150.8 KB 0644
select_icp_mrr_bka_nixbnl.result File 150.06 KB 0644
select_none.result File 149.37 KB 0644
select_none_bka.result File 149.46 KB 0644
select_none_bka_nixbnl.result File 148.66 KB 0644
select_safe.result File 3.92 KB 0644
server_id.require File 32 B 0644
server_id1.require File 34 B 0644
server_uuid.result File 755 B 0644
server_uuid_embedded.result File 325 B 0644
shm.result File 56.74 KB 0644
show_check.result File 71.33 KB 0644
show_processlist.result File 1.84 KB 0644
show_processlist_state.result File 146 B 0644
show_profile.result File 491 B 0644
signal.result File 63.09 KB 0644
signal_code.result File 1020 B 0644
signal_demo1.result File 6.06 KB 0644
signal_demo2.result File 3.86 KB 0644
signal_demo3.result File 3.33 KB 0644
signal_sqlmode.result File 2.51 KB 0644
single_delete_update.result File 24.41 KB 0644
skip_grants.result File 2.47 KB 0644
skip_log_bin.result File 167 B 0644
skip_name_resolve.result File 1.28 KB 0644
slave-running.result File 71 B 0644
slave-stopped.result File 72 B 0644
sort_buffer_size_functionality.result File 6.48 KB 0644
sp-big.result File 1.47 KB 0644
sp-bugs.result File 7.66 KB 0644
sp-code.result File 28.23 KB 0644
sp-destruct.result File 6.84 KB 0644
sp-dynamic.result File 9.55 KB 0644
sp-error.result File 81.43 KB 0644
sp-fib.result File 656 B 0644
sp-lock.result File 21.45 KB 0644
sp-no-code.result File 307 B 0644
sp-prelocking.result File 7.09 KB 0644
sp-security.result File 23.51 KB 0644
sp-threads.result File 2.01 KB 0644
sp-ucs2.result File 4.78 KB 0644
sp-vars.result File 28.09 KB 0644
sp.result File 183.74 KB 0644
sp_debug.result File 735 B 0644
sp_gis.result File 829 B 0644
sp_notembedded.result File 10 KB 0644
sp_stress_case.result File 2.53 KB 0644
sp_sync.result File 3.17 KB 0644
sp_trans.result File 14.3 KB 0644
sp_trans_log.result File 891 B 0644
sp_validation.result File 34.67 KB 0644
sql_mode.result File 17.53 KB 0644
ssl-big.result File 69 B 0644
ssl-crl-revoked-crl.result File 76 B 0644
ssl-sha512.result File 376 B 0644
ssl.result File 56.89 KB 0644
ssl_8k_key.result File 42 B 0644
ssl_and_innodb.result File 183 B 0644
ssl_ca.result File 857 B 0644
ssl_cipher.result File 254 B 0644
ssl_compress.result File 56.52 KB 0644
ssl_connect.result File 10 B 0644
ssl_crl.result File 1.14 KB 0644
ssl_crl_clients-valid.result File 1.01 KB 0644
ssl_crl_clients.result File 427 B 0644
ssl_crl_clients_valid.result File 620 B 0644
ssl_crl_crlpath.result File 728 B 0644
ssl_mode.result File 1.29 KB 0644
ssl_mode_no_ssl.result File 1.06 KB 0644
ssl_verify_identity.result File 1 KB 0644
status.result File 9.83 KB 0644
status2.result File 1.35 KB 0644
status_bug17954.result File 582 B 0644
status_debug.result File 1.06 KB 0644
strict.result File 64.41 KB 0644
strict_autoinc_1myisam.result File 654 B 0644
strict_autoinc_2innodb.result File 654 B 0644
strict_autoinc_3heap.result File 654 B 0644
subquery_all.result File 258.33 KB 0644
subquery_all_bka.result File 258.65 KB 0644
subquery_all_bka_nixbnl.result File 258.42 KB 0644
subquery_bugs.result File 3.05 KB 0644
subquery_mat.result File 94.96 KB 0644
subquery_mat_all.result File 87.69 KB 0644
subquery_mat_none.result File 89.71 KB 0644
subquery_nomat_nosj.result File 258.39 KB 0644
subquery_nomat_nosj_bka.result File 258.64 KB 0644
subquery_nomat_nosj_bka_nixbnl.result File 258.21 KB 0644
subquery_none.result File 258.29 KB 0644
subquery_none_bka.result File 258.38 KB 0644
subquery_none_bka_nixbnl.result File 257.96 KB 0644
subquery_sj_all.result File 368.6 KB 0644
subquery_sj_all_bka.result File 370.21 KB 0644
subquery_sj_all_bka_nixbnl.result File 359 KB 0644
subquery_sj_all_bkaunique.result File 370.58 KB 0644
subquery_sj_dupsweed.result File 370.17 KB 0644
subquery_sj_dupsweed_bka.result File 370.42 KB 0644
subquery_sj_dupsweed_bka_nixbnl.result File 352.52 KB 0644
subquery_sj_dupsweed_bkaunique.result File 370.45 KB 0644
subquery_sj_firstmatch.result File 363.23 KB 0644
subquery_sj_firstmatch_bka.result File 363.32 KB 0644
subquery_sj_firstmatch_bka_nixbnl.result File 351.28 KB 0644
subquery_sj_firstmatch_bkaunique.result File 363.35 KB 0644
subquery_sj_innodb_all.result File 4.74 KB 0644
subquery_sj_innodb_all_bka.result File 4.93 KB 0644
subquery_sj_innodb_all_bka_nixbnl.result File 4.95 KB 0644
subquery_sj_innodb_all_bkaunique.result File 4.99 KB 0644
subquery_sj_innodb_none.result File 4.62 KB 0644
subquery_sj_innodb_none_bka.result File 4.71 KB 0644
subquery_sj_innodb_none_bka_nixbnl.result File 4.7 KB 0644
subquery_sj_innodb_none_bkaunique.result File 4.75 KB 0644
subquery_sj_loosescan.result File 370.08 KB 0644
subquery_sj_loosescan_bka.result File 370.33 KB 0644
subquery_sj_loosescan_bka_nixbnl.result File 352.5 KB 0644
subquery_sj_loosescan_bkaunique.result File 370.36 KB 0644
subquery_sj_mat.result File 378.77 KB 0644
subquery_sj_mat_bka.result File 378.85 KB 0644
subquery_sj_mat_bka_nixbnl.result File 362.06 KB 0644
subquery_sj_mat_bkaunique.result File 378.88 KB 0644
subquery_sj_mat_nosj.result File 376.23 KB 0644
subquery_sj_none.result File 374.82 KB 0644
subquery_sj_none_bka.result File 374.92 KB 0644
subquery_sj_none_bka_nixbnl.result File 367.91 KB 0644
subquery_sj_none_bkaunique.result File 374.95 KB 0644
subselect_debug.result File 409 B 0644
subselect_gis.result File 305 B 0644
subselect_innodb.result File 28.1 KB 0644
subselect_notembedded.result File 752 B 0644
sum_distinct-big.result File 2 KB 0644
sum_distinct.result File 3.14 KB 0644
symlink.result File 7.75 KB 0644
symlink_windows.result File 321 B 0644
synchronization.result File 4.05 KB 0644
sysdate_is_now.result File 76 B 0644
system_mysql_db.result File 13.5 KB 0644
system_mysql_db_refs.result File 2.96 KB 0644
table_definition_cache_functionality.result File 6.9 KB 0644
table_open_cache_functionality.result File 12.78 KB 0644
tablelock.result File 1.5 KB 0644
tablespace.result File 10.13 KB 0644
temp_pool.result File 538 B 0644
temp_table.result File 7.39 KB 0644
temporal_literal.result File 13.16 KB 0644
testdb_only.require File 45 B 0644
thread_cache_size_functionality.result File 5.26 KB 0644
timezone.result File 1.8 KB 0644
timezone2.result File 11.81 KB 0644
timezone3.result File 2.21 KB 0644
timezone4.result File 148 B 0644
timezone_grant.result File 3.76 KB 0644
trans_read_only.result File 1.03 KB 0644
trigger-compat.result File 7.75 KB 0644
trigger-trans.result File 6.46 KB 0644
trigger.result File 68.46 KB 0644
trigger_notembedded.result File 17.03 KB 0644
true.require File 7 B 0644
truncate.result File 3.58 KB 0644
truncate_coverage.result File 2.4 KB 0644
type_binary.result File 3.62 KB 0644
type_bit.result File 16.92 KB 0644
type_bit_innodb.result File 7.31 KB 0644
type_blob.result File 28.87 KB 0644
type_date.result File 18.46 KB 0644
type_datetime.result File 31.24 KB 0644
type_decimal.result File 36.1 KB 0644
type_enum.result File 101.19 KB 0644
type_float.result File 11.97 KB 0644
type_nchar.result File 1.44 KB 0644
type_newdecimal-big.result File 678 B 0644
type_newdecimal.result File 61.46 KB 0644
type_ranges.result File 17.38 KB 0644
type_set.result File 3.99 KB 0644
type_temporal_fractional.result File 635.43 KB 0644
type_temporal_upgrade.result File 9.9 KB 0644
type_time.result File 109.27 KB 0644
type_timestamp.result File 24.69 KB 0644
type_timestamp_explicit.result File 27.35 KB 0644
type_uint.result File 366 B 0644
type_varchar.result File 16.66 KB 0644
type_year.result File 7.78 KB 0644
udf.result File 16.03 KB 0644
udf_services.result File 499 B 0644
udf_skip_grants.result File 223 B 0644
union.result File 52.6 KB 0644
unsafe_binlog_innodb.result File 4.36 KB 0644
update.result File 16.63 KB 0644
upgrade.result File 4.91 KB 0644
user_limits.result File 3.54 KB 0644
user_var-binlog.result File 2.17 KB 0644
user_var.result File 15.34 KB 0644
validate_password_plugin.result File 12.09 KB 0644
varbinary.result File 3.34 KB 0644
variables-big.result File 972 B 0644
variables-notembedded.result File 5.78 KB 0644
variables-win.result File 347 B 0644
variables.result File 61.67 KB 0644
variables_community.result File 182 B 0644
variables_debug.result File 2.13 KB 0644
view.result File 178.72 KB 0644
view_alias.result File 6.19 KB 0644
view_grant.result File 76.69 KB 0644
wait_timeout.result File 1.07 KB 0644
warnings.result File 11.21 KB 0644
warnings_engine_disabled.result File 475 B 0644
windows.require File 7 B 0644
windows.result File 1.86 KB 0644
wl6219-csv.result File 7.23 KB 0644
wl6219-innodb.result File 7.27 KB 0644
wl6219-memory.result File 7.27 KB 0644
wl6219-merge.result File 5.99 KB 0644
wl6219-myisam.result File 7.27 KB 0644
wl6219-upgrade.result File 7.33 KB 0644
wl6301_1_not_windows.result File 44 B 0644
wl6301_2_not_windows.result File 46 B 0644
wl6301_3.result File 89 B 0644
wl6443_deprecation.result File 10.71 KB 0644
xa.result File 7.13 KB 0644
xml.result File 41.78 KB 0644