CREATE TABLE t1 (pk INT PRIMARY KEY, c1 VARCHAR(1)) ENGINE=MyISAM;
CREATE TABLE t1 (pk INT PRIMARY KEY, c1 VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'v'),(2,'v'),(3,'c'),(4,NULL),(5,'x');
INSERT INTO t1 VALUES (1,'v'),(2,'v'),(3,'c'),(4,NULL),(5,'x');
CREATE TABLE t2 (c2 VARCHAR(1)) ENGINE=MyISAM;
CREATE TABLE t2 (c2 VARCHAR(1)) ENGINE=MyISAM;
...
@@ -2953,4 +2947,27 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -2953,4 +2947,27 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1`
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1`
DROP TABLE t1,t2,t3;
DROP TABLE t1,t2,t3;
#
# MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY
#
SET @tmp_mdev5059=@@join_cache_level;
SET join_cache_level = 3;
set @tmp_os_mdev5059= @@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM;
CREATE TABLE t1 (pk INT PRIMARY KEY, c1 VARCHAR(1)) ENGINE=MyISAM;
CREATE TABLE t1 (pk INT PRIMARY KEY, c1 VARCHAR(1)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,'v'),(2,'v'),(3,'c'),(4,NULL),(5,'x');
INSERT INTO t1 VALUES (1,'v'),(2,'v'),(3,'c'),(4,NULL),(5,'x');
CREATE TABLE t2 (c2 VARCHAR(1)) ENGINE=MyISAM;
CREATE TABLE t2 (c2 VARCHAR(1)) ENGINE=MyISAM;
...
@@ -2967,6 +2961,29 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
...
@@ -2967,6 +2961,29 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1`
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on((`test`.`t1`.`c1` = `test`.`t3`.`c3`))) where (`test`.`t1`.`pk` = `test`.`t1`.`pk`) order by 'x',`test`.`t1`.`c1`
DROP TABLE t1,t2,t3;
DROP TABLE t1,t2,t3;
#
# MDEV-5059: Wrong result (missing row) wih semijoin, join_cache_level > 2, LEFT JOIN, ORDER BY
#
SET @tmp_mdev5059=@@join_cache_level;
SET join_cache_level = 3;
set @tmp_os_mdev5059= @@optimizer_switch;
set optimizer_switch=default;
CREATE TABLE t1 (pk1 INT PRIMARY KEY, i1 INT) ENGINE=MyISAM;