summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/innodb_force_recovery.result
blob: 38892e4c838f4064ae2be49fa5c437eb12014329 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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;
# Restart the server with innodb_force_recovery as 4.
select * from t1;
f1	f2
1	2
insert into t1 values(2, 3);
ERROR HY000: Running in read-only mode
alter table t1 add f3 int not null, algorithm=copy;
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
alter table t1 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t1;
ERROR HY000: Can't create table `test`.`t1` (errno: 165 "Table is read only")
alter table t1 drop index idx, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
update t1 set f1=3 where f2=2;
ERROR HY000: Running in read-only mode
create table t3(f1 int not null)engine=innodb;
ERROR HY000: Can't create table `test`.`t3` (errno: 165 "Table is read only")
drop table t3;
ERROR 42S02: Unknown table 'test.t3'
rename table t1 to t3;
ERROR HY000: Error on rename of './test/t1' to './test/t3' (errno: 165 "Table is read only")
truncate table t1;
ERROR HY000: Table 't1' is read only
drop table t1;
ERROR HY000: Table 't1' is read only
show tables;
Tables_in_test
t1
t2
# Restart the server with innodb_force_recovery as 5.
select * from t2;
f1	f2
1	2
insert into t2 values(2, 3);
ERROR HY000: Running in read-only mode
alter table t2 add f3 int not null, algorithm=copy;
ERROR HY000: Can't create table `test`.`t2` (errno: 165 "Table is read only")
alter table t2 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t2;
ERROR HY000: Can't create table `test`.`t2` (errno: 165 "Table is read only")
update t2 set f1=3 where f2=2;
ERROR HY000: Running in read-only mode
create table t3(f1 int not null)engine=innodb;
ERROR HY000: Can't create table `test`.`t3` (errno: 165 "Table is read only")
drop table t3;
ERROR 42S02: Unknown table 'test.t3'
rename table t2 to t3;
ERROR HY000: Error on rename of './test/t2' to './test/t3' (errno: 165 "Table is read only")
truncate table t2;
ERROR HY000: Table 't2' is read only
drop table t2;
ERROR HY000: Table 't2' is read only
create schema db;
drop schema db;
show tables;
Tables_in_test
t1
t2
# Restart the server with innodb_force_recovery as 6.
select * from t2;
f1	f2
1	2
insert into t2 values(2, 3);
ERROR HY000: Table 't2' is read only
alter table t2 add f3 int not null, algorithm=copy;
ERROR HY000: Table 't2' is read only
alter table t2 add f3 int not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Running in read-only mode. Try ALGORITHM=COPY
drop index idx on t2;
ERROR HY000: Table 't2' is read only
update t2 set f1=3 where f2=2;
ERROR HY000: Table 't2' is read only
create table t3(f1 int not null)engine=innodb;
ERROR HY000: Can't create table `test`.`t3` (errno: 165 "Table is read only")
drop table t1;
ERROR HY000: Table 't1' is read only
rename table t2 to t3;
ERROR HY000: Error on rename of './test/t2' to './test/t3' (errno: 165 "Table is read only")
truncate table t2;
ERROR HY000: Table 't2' is read only
drop table t2;
ERROR HY000: Table 't2' is read only
show tables;
Tables_in_test
t1
t2
# Restart the server with innodb_force_recovery=2
select * from t2;
f1	f2
1	2
begin;
update t2 set f2=3;
connect  con1,localhost,root,,;
# 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;
# Kill the server
# Restart the server with innodb_force_recovery=3
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select * from t2;
f1	f2
1	3
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
select * from t2;
f1	f2
1	2
SET SESSION innodb_lock_wait_timeout=1;
insert into t2 values(1,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into t2 values(9,10);
select * from t2;
f1	f2
1	2
9	10
drop table t2;
show tables;
Tables_in_test