summaryrefslogtreecommitdiff
path: root/mysql-test/t/table_elim.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/table_elim.test')
-rw-r--r--mysql-test/t/table_elim.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 5576362b396..3b584ce2b38 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -223,7 +223,8 @@ create table t1 (a char(10) primary key);
insert into t1 values ('foo'),('bar');
create table t2 (a char(10), unique key(a(2)));
-insert into t2 values ('foo'),('bar');
+insert into t2 values
+ ('foo'),('bar'),('boo'),('car'),('coo'),('par'),('doo'),('tar');
explain select t1.* from t1 left join t2 on t2.a=t1.a;
@@ -499,3 +500,21 @@ WHERE t3.f2 ;
DROP TABLE t1,t2,t3,t4,t5;
+--echo #
+--echo # BUG#884184: Wrong result with RIGHT JOIN + derived_merge
+--echo #
+CREATE TABLE t1 (a int(11), b varchar(1)) ;
+INSERT IGNORE INTO t1 VALUES (0,'g');
+
+CREATE TABLE t3 ( a varchar(1)) ;
+INSERT IGNORE INTO t3 VALUES ('g');
+
+CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)) ;
+create view v1 as SELECT t1.* FROM t1 LEFT JOIN t2 ON ( t1.a = t2.a ) WHERE t2.a <> 0;
+
+SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+
+drop view v1;
+DROP TABLE t1,t2,t3;
+