diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2015-02-25 16:58:36 +0300 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2015-02-25 16:58:36 +0300 |
commit | 4a3e94e0259cbe2dea9d1d64a6bd68feb4a70084 (patch) | |
tree | 04cd09d3e3a17be6990ea3e985acf16e146442b0 | |
parent | f825b5a4ee1a9d40cff2f065fd7ea5cd8895ee60 (diff) | |
download | mariadb-git-4a3e94e0259cbe2dea9d1d64a6bd68feb4a70084.tar.gz |
MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy
Add a testcase. The bug itself was fixed by the fix for MDEV-7316.
-rw-r--r-- | mysql-test/r/selectivity_innodb.result | 24 | ||||
-rw-r--r-- | mysql-test/t/selectivity_innodb.test | 30 |
2 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 558e370c6e1..0acbb465ba8 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1512,6 +1512,30 @@ select * from t1 where col2 != true; col1 col2 drop table t1; # +# MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy +# +CREATE TABLE t1 ( +parent_id int, +child_group_id int, +child_user_id int, +KEY (parent_id,child_group_id,child_user_id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +id int, +lower_group_name varchar(255), +directory_id int(20), +UNIQUE KEY (directory_id) +) ENGINE=InnoDB; +CREATE TABLE t3 (id int) ENGINE=InnoDB; +insert into t1 values (1,1,1),(2,2,2); +insert into t2 values (10,'foo',10),(20,'bar',20); +insert into t3 values (101),(102); +set use_stat_tables = PREFERABLY, optimizer_use_condition_selectivity = 3; +select * from t1, t2, t3 +where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_name='foo' and t1.parent_id=t2.id and t2.directory_id=10; +parent_id child_group_id child_user_id id lower_group_name directory_id id +drop table t1,t2,t3; +# # End of 10.0 tests # set use_stat_tables= @tmp_ust; diff --git a/mysql-test/t/selectivity_innodb.test b/mysql-test/t/selectivity_innodb.test index 5674cb5c006..d6a77eac600 100644 --- a/mysql-test/t/selectivity_innodb.test +++ b/mysql-test/t/selectivity_innodb.test @@ -80,6 +80,36 @@ select * from t1 where col2 != true; drop table t1; --echo # +--echo # MDEV-7413: optimizer_use_condition_selectivity > 2 crashes 10.0.15+maria-1~wheezy +--echo # + +CREATE TABLE t1 ( + parent_id int, + child_group_id int, + child_user_id int, + KEY (parent_id,child_group_id,child_user_id) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + id int, + lower_group_name varchar(255), + directory_id int(20), + UNIQUE KEY (directory_id) +) ENGINE=InnoDB; + +CREATE TABLE t3 (id int) ENGINE=InnoDB; + +insert into t1 values (1,1,1),(2,2,2); +insert into t2 values (10,'foo',10),(20,'bar',20); +insert into t3 values (101),(102); +set use_stat_tables = PREFERABLY, optimizer_use_condition_selectivity = 3; + +select * from t1, t2, t3 +where t1.child_user_id=t3.id and t1.child_group_id is null and t2.lower_group_name='foo' and t1.parent_id=t2.id and t2.directory_id=10; + +drop table t1,t2,t3; + +--echo # --echo # End of 10.0 tests --echo # |