diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-03-21 11:06:27 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-03-21 11:06:27 +0400 |
commit | fb2501e2d4cf099bfea0cc1ef9d441ad08c3ee68 (patch) | |
tree | c3b91a9c787e802b6817fd8d4b5d0b844928a90e /mysql-test | |
parent | 8f607aae127439e132dae00b2750727162f4d564 (diff) | |
download | mariadb-git-fb2501e2d4cf099bfea0cc1ef9d441ad08c3ee68.tar.gz |
MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
- Set MI_INFO::external_ref for MyISAM tables that are parts of myisamMRG table.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/merge.result | 130 | ||||
-rw-r--r-- | mysql-test/t/merge.test | 35 |
2 files changed, 165 insertions, 0 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 1e1e6aeaa6b..105a1f9f4c2 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -2369,3 +2369,133 @@ ERROR HY000: Can't reopen table: 'm1' UNLOCK TABLES; DROP TABLE t1, t2, t3, m1; End of 5.1 tests +# +# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg +# +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t2 ( i int ) engine=myisam; +insert into t2 values (1),(2); +create table t3 (a int, b int, filler char(100), key(a), key(b)) engine=myisam; +create table t4 like t3; +insert into t3 +select A.a+10*B.a+100*C.a, +A.a+10*B.a+100*C.a, +'filler-data-FILLER-DATA-qqq' +from t1 A, t1 B, t1 C where C.a < 5; +insert into t4 +select A.a+10*B.a+100*C.a, +A.a+10*B.a+100*C.a, +'filler-data-FILLER-DATA-qqq' +from t1 A, t1 B, t1 C where C.a >= 5; +create table t5 like t3; +alter table t5 engine=merge; +alter table t5 union(t3, t4); +update t5 set b=999, a=999 where b>950; +explain +select * from t2, t5 where t5.a=999 and t5.b=999; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t5 index_merge a,b a,b 5,5 NULL 6 Using intersect(a,b); Using where; Using join buffer (flat, BNL join) +select * from t2, t5 where t5.a=999 and t5.b=999; +i a b filler +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +1 999 999 filler-data-FILLER-DATA-qqq +2 999 999 filler-data-FILLER-DATA-qqq +drop table t5; +drop table t1,t2,t3,t4; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index eecf892869f..abb7c3c7da2 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -1865,6 +1865,41 @@ DROP TABLE t1, t2, t3, m1; --echo End of 5.1 tests +--echo # +--echo # MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg +--echo # +create table t1 (a int); +insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); + +create table t2 ( i int ) engine=myisam; +insert into t2 values (1),(2); + +create table t3 (a int, b int, filler char(100), key(a), key(b)) engine=myisam; +create table t4 like t3; +insert into t3 + select A.a+10*B.a+100*C.a, + A.a+10*B.a+100*C.a, + 'filler-data-FILLER-DATA-qqq' + from t1 A, t1 B, t1 C where C.a < 5; +insert into t4 + select A.a+10*B.a+100*C.a, + A.a+10*B.a+100*C.a, + 'filler-data-FILLER-DATA-qqq' + from t1 A, t1 B, t1 C where C.a >= 5; + +create table t5 like t3; +alter table t5 engine=merge; +alter table t5 union(t3, t4); + +update t5 set b=999, a=999 where b>950; + +explain +select * from t2, t5 where t5.a=999 and t5.b=999; +select * from t2, t5 where t5.a=999 and t5.b=999; + +drop table t5; +drop table t1,t2,t3,t4; + --disable_result_log --disable_query_log eval set global storage_engine=$default; |