diff options
author | Igor Babaev <igor@askmonty.org> | 2013-04-08 17:40:58 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-04-08 17:40:58 -0700 |
commit | ddb84f909c4e03762ffe26e2bde9620ffa1d13fd (patch) | |
tree | ddf03f3bf22924782e8bb5245e7a7d1b64fc6597 /mysql-test/t/selectivity.test | |
parent | e3bf08d4b1c8d73072227f0920b6f4e8c6441591 (diff) | |
download | mariadb-git-ddb84f909c4e03762ffe26e2bde9620ffa1d13fd.tar.gz |
Fixed mdev-4378.
Uninitialized field cond_selectivity of the Field objects created
for the fields of a temporary table could cause an assertion abort.
Diffstat (limited to 'mysql-test/t/selectivity.test')
-rw-r--r-- | mysql-test/t/selectivity.test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index d8ab19ac28a..ddc74a5b34f 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -526,5 +526,40 @@ DROP TABLE t1; set use_stat_tables=@save_use_stat_tables; +--echo # +--echo # Bug mdev-4378: 2-way join with a materialized IN subquery in WHERE +--echo # when optimizer_use_condition_selectivity=4 +--echo # + +set use_stat_tables=PREFERABLY; +set histogram_size=50; +set histogram_type=SINGLE_PREC_HB; + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (8),(9),(6); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (8),(1),(8),(9),(24),(6),(1),(6),(2),(4); + +CREATE TABLE t3 (ln VARCHAR(16)) ENGINE=MyISAM; +INSERT INTO t3 VALUES +('smith'),('black'),('white'),('jones'), +('brown'),('taylor'),('anderson'),('taylor'); + +ANALYZE TABLE t1, t2, t3; +FLUSH TABLES; + +set optimizer_use_condition_selectivity=4; + +SELECT * FROM t1, t2 WHERE 'garcia' IN ( SELECT MIN( ln ) FROM t3 WHERE ln = 'sun' ); + +set histogram_size=@save_histogram_size; +set histogram_type=@save_histogram_type; +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; + +DROP TABLE t1,t2,t3; + +set use_stat_tables=@save_use_stat_tables; + set use_stat_tables=@save_use_stat_tables; |