MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex share->mutex that was locked" on attempt to recover an archive table

This commit is contained in:
Sergei Golubchik 2013-06-13 15:13:13 +02:00
parent 5dee28b1c8
commit 3ddfab5e3c
3 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,11 @@
create table t1 (a int) engine=archive;
insert into t1 values (1);
select * from t1;
Got one of the listed errors
insert into t1 values (2);
ERROR HY000: Table 't1' is marked as crashed and should be repaired
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair error Corrupt
drop table t1;
ERROR 42S02: Unknown table 't1'

View file

@ -0,0 +1,18 @@
#
# MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex share->mutex that was locked" on attempt to recover an archive table
#
--source include/have_archive.inc
--let $datadir = `SELECT @@datadir`
create table t1 (a int) engine=archive;
insert into t1 values (1);
--remove_file $datadir/test/t1.ARZ
--error 13,1017
select * from t1;
--error ER_CRASHED_ON_USAGE
insert into t1 values (2);
repair table t1;
--error ER_BAD_TABLE_ERROR
drop table t1;

View file

@ -1417,7 +1417,10 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
mysql_mutex_lock(&share->mutex);
if (init_archive_reader())
{
mysql_mutex_unlock(&share->mutex);
DBUG_RETURN(errno);
}
// now we close both our writer and our reader for the rename
if (share->archive_write_open)