diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-03-29 19:27:06 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-03-29 19:27:06 +0400 |
commit | 3345e7564d033313ac54ca34d1505d6a2e78cdad (patch) | |
tree | e1fabb2571e0459524c503ca55214966be0192a3 /mysql-test | |
parent | d4de82d93e58a74172960853b07c717377f57e6b (diff) | |
download | mariadb-git-3345e7564d033313ac54ca34d1505d6a2e78cdad.tar.gz |
MDEV-4335: Unexpected results when selecting on information_schema
- When converting a subquery to a semi-join, propagate OPTION_SCHEMA_TABLE.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/subselect_sj.result | 10 | ||||
-rw-r--r-- | mysql-test/r/subselect_sj_jcl6.result | 10 | ||||
-rw-r--r-- | mysql-test/t/subselect_sj.test | 7 |
3 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 2f9f3da3cfd..d32cba1952b 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2772,4 +2772,14 @@ execute stmt; a b deallocate prepare stmt; drop table t1,t2; +# +# MDEV-4335: Unexpected results when selecting on information_schema +# +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +db +mysql +information_schema +DROP TABLE t1; set optimizer_switch=@subselect_sj_tmp; diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index de95dd80529..55068ce257a 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -2786,6 +2786,16 @@ execute stmt; a b deallocate prepare stmt; drop table t1,t2; +# +# MDEV-4335: Unexpected results when selecting on information_schema +# +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +db +information_schema +mysql +DROP TABLE t1; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 650c9d73893..c05896fadda 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2481,6 +2481,13 @@ execute stmt; deallocate prepare stmt; drop table t1,t2; +--echo # +--echo # MDEV-4335: Unexpected results when selecting on information_schema +--echo # +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +DROP TABLE t1; # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; |