1
0
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:
ingo@mysql.com
2005-03-02 10:35:00 +01:00
parent af2999b753
commit d3d7c46b1c
5 changed files with 61 additions and 1 deletions

View File

@@ -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;