Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/innodb/t/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 4 kB image not shown  

Quelle  innodb_force_recovery.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[152] ABAP[96] Masm[88]} [Methode: maximale Elemente, drei Dimensionen]

# Not supported in embedded
--source include/not_embedded.inc

# This test case needs InnoDB.
-- source include/have_innodb.inc

--disable_query_log
call mtr.add_suppression("InnoDB: Failed to find tablespace for table .* in the cache. Attempting to load the tablespace with space id");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t[12], old maximum was");
call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: cannot fulfill innodb_log_recovery_target=20480<");
--enable_query_log

create table t1(f1 int not null, f2 int not null, index idx(f2))engine=innodb;
create table t2(f1 int primary key, f2 int, index idx(f2))engine=innodb;
insert into t1 values(1, 2);
insert into t2 values(1, 2);

SET GLOBAL innodb_fast_shutdown = 0;

--let $restart_parameters= --innodb-log-recovery-target=20480
--source include/restart_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN= InnoDB: cannot fulfill innodb_log_recovery_target=20480<.*
--source include/search_pattern_in_file.inc

--let $restart_parameters= --innodb-force-recovery=4
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;

select variable_name,variable_value from information_schema.global_status
WHERE variable_name LIKE 'innodb_buffer_pool_%_requests';
select * from t1;
select variable_name from information_schema.global_status
WHERE variable_name LIKE 'innodb_buffer_pool_%_requests' and variable_value>0;

begin;
insert into t1 values(2, 3);
rollback;
select variable_name from information_schema.global_status
WHERE variable_name LIKE 'innodb_buffer_pool_%_requests' and variable_value>0;

alter table t1 add f3 int not null, algorithm=copy;

alter table t1 add f4 int not null, algorithm=inplace;

drop index idx on t1;

update t1 set f1=3 where f2=2;

create table t3(f1 int not null)engine=innodb;
drop table t3;

rename table t1 to t3;
rename table t3 to t1;
truncate table t1;

show tables;

--let $restart_parameters= --innodb-force-recovery=5
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;

select * from t2;

--error ER_READ_ONLY_MODE
insert into t2 values(2, 3);

--error ER_CANT_CREATE_TABLE
alter table t2 add f3 int not null, algorithm=copy;

--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t2 add f3 int not null, algorithm=inplace;

--error ER_CANT_CREATE_TABLE
drop index idx on t2;

--error ER_READ_ONLY_MODE
update t2 set f1=3 where f2=2;

--error ER_CANT_CREATE_TABLE
create table t3(f1 int not null)engine=innodb;

--error ER_OPEN_AS_READONLY
drop table t3;

--error ER_ERROR_ON_RENAME
rename table t2 to t3;

--error ER_OPEN_AS_READONLY
truncate table t2;

--error ER_OPEN_AS_READONLY
drop table t2;

create schema db;
drop schema db;
show tables;

--let $restart_parameters= --innodb-force-recovery=6
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;

select * from t2;

--error ER_OPEN_AS_READONLY
insert into t2 values(2, 3);

--error ER_OPEN_AS_READONLY
alter table t2 add f3 int not null, algorithm=copy;

--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t2 add f3 int not null, algorithm=inplace;

--error ER_OPEN_AS_READONLY
drop index idx on t2;

--error ER_OPEN_AS_READONLY
update t2 set f1=3 where f2=2;

--error ER_CANT_CREATE_TABLE
create table t3(f1 int not null)engine=innodb;

--error ER_OPEN_AS_READONLY
drop table t1;

--error ER_ERROR_ON_RENAME
rename table t2 to t3;

--error ER_OPEN_AS_READONLY
truncate table t2;

--error ER_OPEN_AS_READONLY
drop table t2;
show tables;

--let $restart_parameters= --innodb-force-recovery=2
--source include/restart_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;

select * from t2;
begin;
update t2 set f2=3;

connect (con1,localhost,root,,);
--echo # Force a redo log flush of the above uncommitted UPDATE
SET GLOBAL innodb_flush_log_at_trx_commit=1;
drop table t1;
disconnect con1;

connection default;
--source include/kill_mysqld.inc

--let $restart_parameters= --innodb-force-recovery=3
--source include/start_mysqld.inc
let $status=`SHOW ENGINE INNODB STATUS`;

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
--disable_ps2_protocol
select * from t2;
--enable_ps2_protocol
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
select * from t2;
SET SESSION innodb_lock_wait_timeout=1;
--error ER_LOCK_WAIT_TIMEOUT
insert into t2 values(1,2);
insert into t2 values(9,10);

--let $restart_parameters=
--source include/restart_mysqld.inc

select * from t2;
drop table t2;
show tables;

[Dauer der Verarbeitung: 0.25 Sekunden, vorverarbeitet 2026-10-08]