diff options
Diffstat (limited to 'mysql-test/r/subselect_sj.result')
-rw-r--r-- | mysql-test/r/subselect_sj.result | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index 92c626eca61..56c3044c4e4 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -2852,4 +2852,36 @@ field1 o o DROP TABLE t1, t2; +# +# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN... +# (testcase only) +# +SET join_cache_level = 5; +SET optimizer_switch = 'semijoin=on'; +CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e'); +CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM; +INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g'); +SELECT a, COUNT(*) AS cnt +FROM t1 LEFT JOIN t2 ON (d = b) +WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' ) +GROUP BY a ORDER BY a, cnt LIMIT 2; +a cnt +1 1 +4 1 +drop table t1, t2; +# +# MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ... +# +CREATE TABLE t1 (b INT, c VARCHAR(1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES (7,'v'),(0,'s'); +CREATE TABLE t2 (a INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (0),(8); +SELECT c, SUM( DISTINCT b ) AS sm FROM t1 +WHERE ( 5, 108 ) IN ( SELECT MIN(a), MAX(a) FROM t2 ) +GROUP BY b +HAVING c <> ( SELECT MAX( c ) FROM t1 ) +ORDER BY sm; +c sm +DROP TABLE t1,t2; set optimizer_switch=@subselect_sj_tmp; |