summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_no_semijoin.result
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-01-10 23:26:00 +0200
committerunknown <sanja@montyprogram.com>2012-01-10 23:26:00 +0200
commitcf31ccc33c2f5ac5e2ae92c672bd54cc7ce63107 (patch)
tree5ecc3fc90fc3af76c08e9603dad95e3b735c6ccb /mysql-test/r/subselect_no_semijoin.result
parentd21189d7759e8223e06ce28bc75b3a5c87da6db1 (diff)
downloadmariadb-git-cf31ccc33c2f5ac5e2ae92c672bd54cc7ce63107.tar.gz
Fix for LP BUG#908269 Wrong result with subquery in select list, EXISTS, constant MyISAM/Aria table.
Problem: When building the condition for JOIN::outer_ref_cond the optimizer forgot to take into account that this condition could depend on constant tables as well.
Diffstat (limited to 'mysql-test/r/subselect_no_semijoin.result')
-rw-r--r--mysql-test/r/subselect_no_semijoin.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index b92230cff3b..9b2370efd61 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -5905,6 +5905,30 @@ a
2009-02-02
set @@optimizer_switch=@old_optimizer_switch;
drop table t1;
+#
+# LP BUG#908269 incorrect condition in case of subqueries depending
+# on constant tables
+#
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1),(5);
+CREATE TABLE t2 ( b INT ) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1);
+CREATE TABLE t3 ( c INT );
+INSERT INTO t3 VALUES (4),(5);
+SET optimizer_switch='subquery_cache=off';
+SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
+( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) )
+1
+NULL
+SELECT ( SELECT b FROM t2 WHERE b = a OR b * 0) FROM t1;
+( SELECT b FROM t2 WHERE b = a OR b * 0)
+1
+NULL
+SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
+( SELECT b FROM t2 WHERE b = a OR rand() * 0)
+1
+NULL
+drop table t1,t2,t3;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
set @optimizer_switch_for_subselect_test=null;