mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-19587 innodb_force_recovery=5 crash on DROP SCHEMA
At higher levels of innodb_force_recovery, the InnoDB transaction subsystem will not be set up at all. At slightly lower levels, recovered transactions will not be rolled back, and DDL operations could hang due to locks being held at all. Let us consistently refuse all writes if the predicate high_level_read_only holds. We failed to refuse DROP TABLE and DROP DATABASE. (Refusing DROP TABLE is a partial backport from MDEV-19570 in the 10.5 branch.)
This commit is contained in:
@ -51,6 +51,7 @@ rename table t1 to t3;
|
||||
--error ER_OPEN_AS_READONLY
|
||||
truncate table t1;
|
||||
|
||||
--error ER_OPEN_AS_READONLY
|
||||
drop table t1;
|
||||
show tables;
|
||||
|
||||
@ -76,10 +77,10 @@ drop index idx on t2;
|
||||
update t2 set f1=3 where f2=2;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1(f1 int not null)engine=innodb;
|
||||
create table t3(f1 int not null)engine=innodb;
|
||||
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
drop table t1;
|
||||
drop table t3;
|
||||
|
||||
--error ER_ERROR_ON_RENAME
|
||||
rename table t2 to t3;
|
||||
@ -89,6 +90,9 @@ truncate table t2;
|
||||
|
||||
--error ER_OPEN_AS_READONLY
|
||||
drop table t2;
|
||||
|
||||
create schema db;
|
||||
drop schema db;
|
||||
show tables;
|
||||
|
||||
--echo # Restart the server with innodb_force_recovery as 6.
|
||||
@ -113,9 +117,9 @@ drop index idx on t2;
|
||||
update t2 set f1=3 where f2=2;
|
||||
|
||||
--error ER_CANT_CREATE_TABLE
|
||||
create table t1(f1 int not null)engine=innodb;
|
||||
create table t3(f1 int not null)engine=innodb;
|
||||
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
--error ER_OPEN_AS_READONLY
|
||||
drop table t1;
|
||||
|
||||
--error ER_ERROR_ON_RENAME
|
||||
@ -137,10 +141,9 @@ begin;
|
||||
update t2 set f2=3;
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
create table t3(a int)engine=innodb;
|
||||
--echo # Force a redo log flush of the above uncommitted UPDATE
|
||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||
drop table t3;
|
||||
drop table t1;
|
||||
disconnect con1;
|
||||
|
||||
connection default;
|
||||
|
Reference in New Issue
Block a user