diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-06-20 12:31:17 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-06-20 12:31:17 +0300 |
commit | 8baf9b0c469e2845d15cc1181bc6b101cdfba087 (patch) | |
tree | f5808173b56692f71874213639401af1e18cb146 /mysql-test/r/subselect_sj2_mat.result | |
parent | 5e4f4ec8211b61e71ec29069161d0f41f4c05376 (diff) | |
parent | ded614d7dbc930e373d1a69a0d2a7e4bf0a2c6d3 (diff) | |
download | mariadb-git-8baf9b0c469e2845d15cc1181bc6b101cdfba087.tar.gz |
Merge remote-tracking branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/r/subselect_sj2_mat.result')
-rw-r--r-- | mysql-test/r/subselect_sj2_mat.result | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj2_mat.result b/mysql-test/r/subselect_sj2_mat.result index c00ce7ec227..5d0c64e9ddb 100644 --- a/mysql-test/r/subselect_sj2_mat.result +++ b/mysql-test/r/subselect_sj2_mat.result @@ -1612,3 +1612,25 @@ Warnings: Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t2`) where ((rand() < 0)) drop table t1,t2; set optimizer_switch=@save_optimizer_switch; +# +# mdev-12855: materialization of a semi-join subquery + ORDER BY +# +CREATE TABLE t1 (f1 varchar(8), KEY(f1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES ('qux'),('foo'); +CREATE TABLE t2 (f2 varchar(8)) ENGINE=InnoDB; +INSERT INTO t2 VALUES ('bar'),('foo'),('qux'); +SELECT f1 FROM t1 +WHERE f1 IN ( SELECT f2 FROM t2 WHERE f2 > 'bar' ) +HAVING f1 != 'foo' +ORDER BY f1; +f1 +qux +explain SELECT f1 FROM t1 +WHERE f1 IN ( SELECT f2 FROM t2 WHERE f2 > 'bar' ) +HAVING f1 != 'foo' +ORDER BY f1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index f1 f1 11 NULL 2 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1 +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where +DROP TABLE t1,t2; |