diff options
author | Igor Babaev <igor@askmonty.org> | 2011-08-11 22:34:41 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-08-11 22:34:41 -0700 |
commit | 07e9d34c5478ac18d77689e99f461e1a9f8a873a (patch) | |
tree | a755d6bce4de6db9bef78ebaee70908f0299c932 /mysql-test/r/derived_view.result | |
parent | 8b56830f7b15df159b51077463211dd9aa412167 (diff) | |
download | mariadb-git-07e9d34c5478ac18d77689e99f461e1a9f8a873a.tar.gz |
Added a test case for LP bug #823835 - a duplicate of bug 823189.
Diffstat (limited to 'mysql-test/r/derived_view.result')
-rw-r--r-- | mysql-test/r/derived_view.result | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/derived_view.result b/mysql-test/r/derived_view.result index 034e8d6ff56..1e6604d6435 100644 --- a/mysql-test/r/derived_view.result +++ b/mysql-test/r/derived_view.result @@ -1243,4 +1243,31 @@ a b 1 NULL DROP VIEW v1; DROP TABLE t1,t2; +# +# LP bug #823835: a duplicate of #823189 with derived table +# +CREATE TABLE t1 (a varchar(32)) ; +INSERT INTO t1 VALUES ('r'), ('p'); +CREATE TABLE t2 (a int NOT NULL, b varchar(32)) ; +INSERT INTO t2 VALUES (28,'j'); +CREATE TABLE t3 (a int); +INSERT INTO t3 VALUES (0), (0); +EXPLAIN EXTENDED +SELECT * FROM (SELECT * FROM t1) AS t +WHERE EXISTS (SELECT t2.a FROM t3 RIGHT JOIN t2 ON (t3.a = t2.a) +WHERE t2.b < t.a); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +3 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 1 100.00 +3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1276 Field or reference 't.a' of SELECT #3 was resolved in SELECT #1 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(select 28 from `test`.`t2` left join `test`.`t3` on((`test`.`t3`.`a` = 28)) where ('j' < `test`.`t1`.`a`)) +SELECT * FROM (SELECT * FROM t1) AS t +WHERE EXISTS (SELECT t2.a FROM t3 RIGHT JOIN t2 ON (t3.a = t2.a) +WHERE t2.b < t.a); +a +r +p +DROP TABLE t1,t2,t3; set optimizer_switch=@exit_optimizer_switch; |