summaryrefslogtreecommitdiff
path: root/mysql-test/t/join.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-03-01 00:29:59 +0300
committerSergey Petrunya <psergey@askmonty.org>2011-03-01 00:29:59 +0300
commit10b8119ad3e5fa10fdddfb959a2e9878888bfed6 (patch)
tree550f81ccf3fbb2313af55241018f2186c6c4f31e /mysql-test/t/join.test
parent1b03a028fcc4a4ac6337a64c9bb85add5c1ae6bc (diff)
downloadmariadb-git-10b8119ad3e5fa10fdddfb959a2e9878888bfed6.tar.gz
BUG#724275: Crash in JOIN::optimize in maria-5.3
- Make equality-substitution-for-ref-access code in JOIN::optimize() treat join_tab->ref.key_copy correctly (in the way create_ref_for_key() has filled it).
Diffstat (limited to 'mysql-test/t/join.test')
-rw-r--r--mysql-test/t/join.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index cf431ace24c..29b9dcf4734 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -941,3 +941,26 @@ SHOW STATUS LIKE 'Handler_read_%';
DROP TABLE t1, t2;
--echo End of 5.1 tests
+
+--echo #
+--echo # BUG#724275: Crash in JOIN::optimize in maria-5.3
+--echo #
+
+create table t1 (a int);
+insert into t1 values (1),(2);
+insert into t1 select * from t1;
+
+create table t2 (a int, b int, key(a,b));
+insert into t2 values (1,1),(1,2),(1,3),(1,4),(2,5),(2,6),(2,7),(2,8),(2,9);
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+
+create table t3 (a int, b int, key(a));
+insert into t3 values (1,1),(2,2);
+select * from
+ t3 straight_join t1 straight_join t2 force index(a)
+where t2.a=1 and t2.b=t1.a and t1.a=t3.b and t3.a=1;
+
+drop table t1,t2,t3;
+