Commit 3ddfab5e authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex...

MDEV-4444 Server crashes with "safe_mutex: Trying to destroy a mutex share->mutex that was locked" on attempt to recover an archive table
parent 5dee28b1
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'
#
# 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;
...@@ -1417,7 +1417,10 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) ...@@ -1417,7 +1417,10 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
mysql_mutex_lock(&share->mutex); mysql_mutex_lock(&share->mutex);
if (init_archive_reader()) if (init_archive_reader())
{
mysql_mutex_unlock(&share->mutex);
DBUG_RETURN(errno); DBUG_RETURN(errno);
}
// now we close both our writer and our reader for the rename // now we close both our writer and our reader for the rename
if (share->archive_write_open) if (share->archive_write_open)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment