summaryrefslogtreecommitdiff
path: root/mysql-test/t/selectivity_no_engine.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-06-07 19:00:26 +0200
committerSergey Petrunya <psergey@askmonty.org>2014-06-07 19:00:26 +0200
commit71df035551939d4200f54280493d670f31eba796 (patch)
tree2371e384490dfb8b2ef21c9cee26c35e7e50663f /mysql-test/t/selectivity_no_engine.test
parent414e8388bf8925ba128e10adc0086589f9f36016 (diff)
downloadmariadb-git-71df035551939d4200f54280493d670f31eba796.tar.gz
MDEV-6308: Server crashes in table_multi_eq_cond_selectivity with ...
- In table_cond_selectivity(), reset keyuse variable between the loops.
Diffstat (limited to 'mysql-test/t/selectivity_no_engine.test')
-rw-r--r--mysql-test/t/selectivity_no_engine.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/t/selectivity_no_engine.test b/mysql-test/t/selectivity_no_engine.test
index 87e6b629762..4a7ad8a42c9 100644
--- a/mysql-test/t/selectivity_no_engine.test
+++ b/mysql-test/t/selectivity_no_engine.test
@@ -162,6 +162,34 @@ SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE NOT ( t1_1.a <> 'baz');
DROP TABLE t1;
--echo #
+--echo # MDEV-6308: Server crashes in table_multi_eq_cond_selectivity with ...
+--echo #
+CREATE TABLE t1 (
+ id varchar(40) COLLATE utf8_bin,
+ dt datetime,
+ PRIMARY KEY (id)
+);
+
+INSERT INTO t1 VALUES ('foo','2011-04-12 05:18:08'),
+ ('bar','2013-09-19 11:37:03');
+
+CREATE TABLE t2 (
+ t1_id varchar(40) COLLATE utf8_bin,
+ f1 varchar(64),
+ f2 varchar(1024),
+ KEY (f1,f2(255))
+);
+
+INSERT INTO t2 VALUES ('foo','baz','qux'),('bar','baz','qux');
+
+set optimizer_use_condition_selectivity=2;
+explain
+select * from t1,t2 where t1.id = t2.t1_id and t2.f2='qux' and t2.f1='baz';
+select * from t1,t2 where t1.id = t2.t1_id and t2.f2='qux' and t2.f1='baz';
+
+drop table t1,t2;
+
+--echo #
--echo # End of the test file
--echo #