mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#8306 - TRUNCATE leads to index corruption
Added a check, if the table, which we are going to create, is open. This can happen if a MERGE mapped table is TRUNCATEd.
This commit is contained in:
@@ -555,3 +555,21 @@ select count(*) from t1 where a is null;
|
||||
count(*)
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (c1 int, index(c1));
|
||||
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
|
||||
insert into t1 values (1);
|
||||
flush tables;
|
||||
select * from t2;
|
||||
c1
|
||||
1
|
||||
flush tables;
|
||||
truncate table t1;
|
||||
insert into t1 values (1);
|
||||
flush tables;
|
||||
select * from t2;
|
||||
c1
|
||||
1
|
||||
truncate table t1;
|
||||
ERROR HY000: MyISAM table 't1' is in use (most likely by a MERGE table). Try FLUSH TABLES.
|
||||
insert into t1 values (1);
|
||||
drop table t1,t2;
|
||||
|
||||
Reference in New Issue
Block a user