diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-09-03 12:58:41 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-09-03 12:58:41 +0200 |
commit | 530a6e74819ec14b5fdc42aa588b236ecb9f2fcd (patch) | |
tree | a4d45b1fd0e434c23577507364fa443226676eb5 /mysql-test/t/subselect_sj2.test | |
parent | 5088cbf4ed7224698678f3eaf406361c6e7db4b8 (diff) | |
parent | 4b41e3c7f33714186c97a6cc2e6d3bb93b050c61 (diff) | |
download | mariadb-git-530a6e74819ec14b5fdc42aa588b236ecb9f2fcd.tar.gz |
Merge branch '10.0' into 10.1
referenced_by_foreign_key2(), needed for InnoDB to compile,
was taken from 10.0-galera
Diffstat (limited to 'mysql-test/t/subselect_sj2.test')
-rw-r--r-- | mysql-test/t/subselect_sj2.test | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 7ee52a0fa8a..5d6639a6d5a 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1410,5 +1410,44 @@ eval explain $query; drop table t3,t2,t1; set optimizer_search_depth=@tmp7474; +--echo # +--echo # +--echo # +CREATE TABLE t1 ( + id int(16) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE t2 ( + id int(16) NOT NULL AUTO_INCREMENT, + t3_id int(16) NOT NULL DEFAULT '0', + t1_id int(16) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + KEY t3_idx (t3_id), + KEY t1_idx (t1_id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE t3 ( + id int(16) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + + +INSERT INTO t3 VALUES (1); + +INSERT INTO t2 VALUES (1, 1, 1); +INSERT INTO t2 VALUES (2, 1, 2); +INSERT INTO t2 VALUES (3, 1, 2); +INSERT INTO t2 VALUES (4, 1, 1); + +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); + +SELECT * FROM t1 WHERE t1.id IN ( + SELECT t2.t1_id FROM t3 JOIN t2 ON t3.id = t2.t3_id WHERE t3.id = 1 +); + +drop table t1,t2,t3; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; |