summaryrefslogtreecommitdiff
path: root/mysql-test/t/join_outer.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-07-21 00:43:37 -0700
committerIgor Babaev <igor@askmonty.org>2011-07-21 00:43:37 -0700
commit4a03a1d777f2c2c4c921a5b52df5da362950b468 (patch)
tree58fc77a84ca87e850e9f03f88660044d1e010d96 /mysql-test/t/join_outer.test
parent2e8542f4620fd64e65eb6e41122bbe166c242a01 (diff)
downloadmariadb-git-4a03a1d777f2c2c4c921a5b52df5da362950b468.tar.gz
Fixed LP bug #813447.
Do not make substitution of a single-row table if it is an inner table of an outer join with on expression containing an expensive subquery.
Diffstat (limited to 'mysql-test/t/join_outer.test')
-rw-r--r--mysql-test/t/join_outer.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 28526a30ae7..71a983bd569 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1106,3 +1106,24 @@ GROUP BY t2.f1, t2.f2;
DROP TABLE t1,t2;
--echo End of 5.1 tests
+
+--echo #
+--echo # LP bug #813447: LEFT JOIN with single-row inner table and
+--echo # a subquery in ON expression
+--echo #
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (0);
+
+CREATE TABLE t2 (a int);
+INSERT INTO t2 VALUES (0);
+
+CREATE TABLE t3 (a int);
+INSERT INTO t3 VALUES (0), (0);
+
+SELECT t2.a FROM t1 LEFT JOIN t2 ON (6) IN (SELECT a FROM t3);
+EXPLAIN EXTENDED
+SELECT t2.a FROM t1 LEFT JOIN t2 ON (6) IN (SELECT a FROM t3);
+
+DROP TABLE t1,t2,t3;
+