summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_sj.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-12-11 19:41:53 -0800
committerIgor Babaev <igor@askmonty.org>2011-12-11 19:41:53 -0800
commit63d32c115dd962b53cf7bcaa340472ee2f44f9e2 (patch)
tree0ab189512324810847cfb828ef3212206b1385a1 /mysql-test/r/subselect_sj.result
parent9b4cd1b0aeb869a6adfe7ad7a530cde27e37bc9e (diff)
downloadmariadb-git-63d32c115dd962b53cf7bcaa340472ee2f44f9e2.tar.gz
Fixed LP bug #901709.
The cause of the reported assertion failure was a division of a double value by 0.
Diffstat (limited to 'mysql-test/r/subselect_sj.result')
-rw-r--r--mysql-test/r/subselect_sj.result31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 9c4368a809b..a7b3cffb8d2 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2118,4 +2118,35 @@ a b
1 1
set optimizer_switch= @tmp_otimizer_switch;
DROP TABLE t1,t2,t3;
+#
+# Bug #901709: assertion failure with record count == 0
+#
+CREATE TABLE t1 (a int, KEY (a));
+INSERT INTO t1 VALUES (4), (6);
+CREATE TABLE t2 (a int, KEY (a));
+INSERT INTO t2 VALUES (4), (6);
+CREATE TABLE t3 (b int);
+INSERT INTO t3 VALUES (4);
+CREATE TABLE t4 (c int);
+SET @tmp_optimizer_switch=@@optimizer_switch;
+SET @@optimizer_switch='semijoin=on';
+SET @@optimizer_switch='materialization=on';
+SET @@optimizer_switch='firstmatch=on';
+SET optimizer_switch='semijoin_with_cache=on';
+SET optimizer_prune_level=0;
+EXPLAIN
+SELECT * FROM t1, t2
+WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 system NULL NULL NULL NULL 1
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
+1 PRIMARY t1 ref a a 5 const 1 Using index
+1 PRIMARY t2 ref a a 5 test.t3.b 1 Using index
+2 MATERIALIZED t4 ALL NULL NULL NULL NULL 0
+SELECT * FROM t1, t2
+WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
+a a
+SET optimizer_prune_level=DEFAULT;
+SET optimizer_switch=@tmp_optimizer_switch;
+DROP TABLE t1,t2,t3,t4;
set optimizer_switch=@subselect_sj_tmp;