diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-01-19 23:44:43 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-01-19 23:44:43 +0400 |
commit | 8bedf1ea1c328fabea14a1ce232794d73814b6d7 (patch) | |
tree | 495db38600e15d1ee636ac4c9d841f79b6981bd0 /mysql-test/t/subselect_sj2.test | |
parent | 0e975ded65510a85173a6d05b9fd4824fbfd07af (diff) | |
download | mariadb-git-8bedf1ea1c328fabea14a1ce232794d73814b6d7.tar.gz |
BUG#912538: Wrong result (missing rows) with semijoin=on, firstmatch=on, ...
- setup_semijoin_dups_elimination() would incorrectly set join_tab->do_firstmatch
when the join order had outer tables interleaved with inner.
Diffstat (limited to 'mysql-test/t/subselect_sj2.test')
-rw-r--r-- | mysql-test/t/subselect_sj2.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 9a664ee9881..30dc20087d1 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1076,5 +1076,19 @@ SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a DROP VIEW v1; DROP TABLE t1,t2,t3,t4; +--echo # +--echo # BUG#912538: Wrong result (missing rows) with semijoin=on, firstmatch=on, ... +--echo # +CREATE TABLE t1 ( a INT NOT NULL, UNIQUE KEY(a) ); +INSERT INTO t1 VALUES (1),(2),(3),(4); + +# t2 needs to be InnoDB +CREATE TABLE t2 ( b INT, c INT ) ENGINE=InnoDB; +INSERT INTO t2 VALUES (1,1); + +SELECT * FROM t1, t2 WHERE c IN (SELECT c FROM t1, t2 WHERE a = b); + +DROP TABLE t1,t2; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; |