Debian Codegraph @

mysql-test/suite/innodb/r/doublewrite_reduced_to_on.result

raw
1 SET GLOBAL innodb_fast_shutdown = 0;
2 # restart
3 SHOW VARIABLES LIKE 'innodb_doublewrite';
4 Variable_name Value
5 innodb_doublewrite ON
6 SHOW VARIABLES LIKE 'innodb_fil_make_page_dirty_debug';
7 Variable_name Value
8 innodb_fil_make_page_dirty_debug 4294967295
9 SHOW VARIABLES LIKE 'innodb_saved_page_number_debug';
10 Variable_name Value
11 innodb_saved_page_number_debug 0
12 create table t1 (f1 int primary key, f2 blob) engine=innodb;
13 START TRANSACTION;
14 INSERT INTO t1 VALUES(1, repeat('#',12));
15 INSERT INTO t1 VALUES(2, repeat('+',12));
16 INSERT INTO t1 VALUES(3, repeat('/',12));
17 INSERT INTO t1 VALUES(4, repeat('-',12));
18 INSERT INTO t1 VALUES(5, repeat('.',12));
19 COMMIT WORK;
20 # ---------------------------------------------------------------
21 # Test Begin: Test if recovery works if first page of user
22 # tablespace is full of zeroes.
23 # Wait for purge to complete
24 # Ensure that dirty pages of table t1 is flushed.
25 FLUSH TABLES t1 FOR EXPORT;
26 UNLOCK TABLES;
27 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACEs
28 WHERE name = 'test/t1' INTO @space_id;
29 SET GLOBAL innodb_checkpoint_disabled=1;
30 SET GLOBAL innodb_doublewrite=DETECT_ONLY;
31 SELECT @@innodb_doublewrite;
32 @@innodb_doublewrite
33 DETECT_ONLY
34 INSERT INTO t1 VALUES(7, repeat('.',12));
35 SELECT @@innodb_doublewrite;
36 @@innodb_doublewrite
37 DETECT_ONLY
38 SET GLOBAL innodb_doublewrite=ON;
39 SELECT @@innodb_doublewrite;
40 @@innodb_doublewrite
41 ON
42 BEGIN;
43 INSERT INTO t1 VALUES (6, repeat('%', 12));
44 SET GLOBAL innodb_checkpoint_disabled = 1;
45 # Make the first page dirty for table t1
46 SET GLOBAL innodb_saved_page_number_debug = 0;
47 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
48 ERROR HY000: Lost connection to MySQL server during query
49 # Make the first page (page_no=0) of the user tablespace
50 # full of zeroes.
51 # restart: --innodb_doublewrite=detect_only
52 CHECK TABLE t1;
53 Table Op Msg_type Msg_text
54 test.t1 check status OK
55 SELECT f1, f2 FROM t1;
56 f1 f2
57 1 ############
58 2 ++++++++++++
59 3 ////////////
60 4 ------------
61 5 ............
62 7 ............
63 # Test End
64 # ---------------------------------------------------------------
65 # Test Begin: Test if recovery works if first page of user
66 # tablespace is corrupted.
67 SELECT space from INFORMATION_SCHEMA.INNODB_TABLESPACES
68 WHERE name = 'test/t1' INTO @space_id;
69 # Ensure that dirty pages of table t1 is flushed.
70 FLUSH TABLES t1 FOR EXPORT;
71 UNLOCK TABLES;
72 SET GLOBAL innodb_checkpoint_disabled=1;
73 SELECT @@innodb_doublewrite;
74 @@innodb_doublewrite
75 DETECT_ONLY
76 SET GLOBAL innodb_doublewrite=ON;
77 SELECT @@innodb_doublewrite;
78 @@innodb_doublewrite
79 ON
80 BEGIN;
81 INSERT INTO t1 VALUES (6, repeat('%', 12));
82 SET GLOBAL innodb_checkpoint_disabled = 1;
83 # Make the first page dirty for table t1
84 SET GLOBAL innodb_saved_page_number_debug = 0;
85 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
86 ERROR HY000: Lost connection to MySQL server during query
87 # Corrupt the first page (page_no=0) of the user tablespace.
88 # restart: --innodb_doublewrite=detect_only
89 CHECK TABLE t1;
90 Table Op Msg_type Msg_text
91 test.t1 check status OK
92 SELECT f1, f2 FROM t1;
93 f1 f2
94 1 ############
95 2 ++++++++++++
96 3 ////////////
97 4 ------------
98 5 ............
99 7 ............
100 # Test End
101 # ---------------------------------------------------------------
102 # Test Begin: Test if recovery works if 2nd page of user
103 # tablespace is full of zeroes.
104 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
105 WHERE name = 'test/t1' INTO @space_id;
106 # Ensure that dirty pages of table t1 is flushed.
107 FLUSH TABLES t1 FOR EXPORT;
108 UNLOCK TABLES;
109 SET GLOBAL innodb_checkpoint_disabled=1;
110 SELECT @@innodb_doublewrite;
111 @@innodb_doublewrite
112 DETECT_ONLY
113 SET GLOBAL innodb_doublewrite=ON;
114 SELECT @@innodb_doublewrite;
115 @@innodb_doublewrite
116 ON
117 BEGIN;
118 INSERT INTO t1 VALUES (6, repeat('%', 400));
119 SET GLOBAL innodb_checkpoint_disabled = 1;
120 # Make the 2nd page dirty for table t1
121 SET GLOBAL innodb_saved_page_number_debug = 1;
122 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
123 ERROR HY000: Lost connection to MySQL server during query
124 # Make the 2nd page (page_no=1) of the tablespace all zeroes.
125 # restart: --innodb_doublewrite=detect_only
126 CHECK TABLE t1;
127 Table Op Msg_type Msg_text
128 test.t1 check status OK
129 SELECT f1, f2 FROM t1;
130 f1 f2
131 1 ############
132 2 ++++++++++++
133 3 ////////////
134 4 ------------
135 5 ............
136 7 ............
137 # Test End
138 # ---------------------------------------------------------------
139 # Test Begin: Test if recovery works if 2nd page of user
140 # tablespace is corrupted.
141 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
142 WHERE name = 'test/t1' into @space_id;
143 # Ensure that dirty pages of table t1 is flushed.
144 FLUSH TABLES t1 FOR EXPORT;
145 UNLOCK TABLES;
146 SET GLOBAL innodb_checkpoint_disabled=1;
147 SELECT @@innodb_doublewrite;
148 @@innodb_doublewrite
149 DETECT_ONLY
150 SET GLOBAL innodb_doublewrite=ON;
151 SELECT @@innodb_doublewrite;
152 @@innodb_doublewrite
153 ON
154 BEGIN;
155 INSERT INTO t1 VALUES (6, repeat('%', 400));
156 SET GLOBAL innodb_checkpoint_disabled = 1;
157 # Make the 2nd page dirty for table t1
158 SET GLOBAL innodb_saved_page_number_debug = 1;
159 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
160 ERROR HY000: Lost connection to MySQL server during query
161 # Corrupt the 2nd page (page_no=1) of the user tablespace.
162 # restart: --innodb_doublewrite=detect_only
163 CHECK TABLE t1;
164 Table Op Msg_type Msg_text
165 test.t1 check status OK
166 SELECT f1, f2 FROM t1;
167 f1 f2
168 1 ############
169 2 ++++++++++++
170 3 ////////////
171 4 ------------
172 5 ............
173 7 ............
174 # Test End
175 # ---------------------------------------------------------------
176 # Test Begin: Test if recovery works if first page of
177 # system tablespace is full of zeroes.
178 SET GLOBAL innodb_master_thread_disabled_debug=1;
179 SELECT @@innodb_doublewrite;
180 @@innodb_doublewrite
181 DETECT_ONLY
182 SET GLOBAL innodb_doublewrite=ON;
183 SELECT @@innodb_doublewrite;
184 @@innodb_doublewrite
185 ON
186 BEGIN;
187 INSERT INTO t1 VALUES (6, repeat('%', 400));
188 SET GLOBAL innodb_checkpoint_disabled = 1;
189 # Make the first page dirty for system tablespace
190 SET GLOBAL innodb_saved_page_number_debug = 0;
191 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
192 ERROR HY000: Lost connection to MySQL server during query
193 # Make the first page (page_no=0) of the system tablespace
194 # all zeroes.
195 # restart: --innodb_doublewrite=detect_only
196 CHECK TABLE t1;
197 Table Op Msg_type Msg_text
198 test.t1 check status OK
199 SELECT f1, f2 FROM t1;
200 f1 f2
201 1 ############
202 2 ++++++++++++
203 3 ////////////
204 4 ------------
205 5 ............
206 7 ............
207 # Test End
208 # ---------------------------------------------------------------
209 # Test Begin: Test if recovery works if first page of
210 # system tablespace is corrupted.
211 SET GLOBAL innodb_master_thread_disabled_debug=1;
212 SELECT @@innodb_doublewrite;
213 @@innodb_doublewrite
214 DETECT_ONLY
215 SET GLOBAL innodb_doublewrite=ON;
216 SELECT @@innodb_doublewrite;
217 @@innodb_doublewrite
218 ON
219 BEGIN;
220 INSERT INTO t1 VALUES (6, repeat('%', 400));
221 SET GLOBAL innodb_checkpoint_disabled = 1;
222 # Make the first page dirty for system tablespace
223 SET GLOBAL innodb_saved_page_number_debug = 0;
224 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
225 ERROR HY000: Lost connection to MySQL server during query
226 # Corrupt the first page (page_no=0) of the system tablespace.
227 # restart: --innodb_doublewrite=detect_only
228 CHECK TABLE t1;
229 Table Op Msg_type Msg_text
230 test.t1 check status OK
231 SELECT f1, f2 FROM t1;
232 f1 f2
233 1 ############
234 2 ++++++++++++
235 3 ////////////
236 4 ------------
237 5 ............
238 7 ............
239 # Test End
240 # ---------------------------------------------------------------
241 # Test Begin: Test if recovery works if 2nd page of
242 # system tablespace is full of zeroes.
243 SET GLOBAL innodb_master_thread_disabled_debug=1;
244 SELECT @@innodb_doublewrite;
245 @@innodb_doublewrite
246 DETECT_ONLY
247 SET GLOBAL innodb_doublewrite=ON;
248 SELECT @@innodb_doublewrite;
249 @@innodb_doublewrite
250 ON
251 BEGIN;
252 INSERT INTO t1 VALUES (6, repeat('%', 400));
253 SET GLOBAL innodb_checkpoint_disabled = 1;
254 # Make the second page dirty for system tablespace
255 SET GLOBAL innodb_saved_page_number_debug = 1;
256 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
257 ERROR HY000: Lost connection to MySQL server during query
258 # Make the 2nd page (page_no=1) of the system tablespace
259 # all zeroes.
260 # restart: --innodb_doublewrite=detect_only
261 CHECK TABLE t1;
262 Table Op Msg_type Msg_text
263 test.t1 check status OK
264 SELECT f1, f2 FROM t1;
265 f1 f2
266 1 ############
267 2 ++++++++++++
268 3 ////////////
269 4 ------------
270 5 ............
271 7 ............
272 # Test End
273 # ---------------------------------------------------------------
274 # Test Begin: Test if recovery works if 2nd page of
275 # system tablespace is corrupted.
276 SET GLOBAL innodb_master_thread_disabled_debug=1;
277 SELECT @@innodb_doublewrite;
278 @@innodb_doublewrite
279 DETECT_ONLY
280 SET GLOBAL innodb_doublewrite=ON;
281 SELECT @@innodb_doublewrite;
282 @@innodb_doublewrite
283 ON
284 BEGIN;
285 INSERT INTO t1 VALUES (6, repeat('%', 400));
286 SET GLOBAL innodb_checkpoint_disabled = 1;
287 # Make the second page dirty for system tablespace
288 SET GLOBAL innodb_saved_page_number_debug = 1;
289 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
290 ERROR HY000: Lost connection to MySQL server during query
291 # Make the 2nd page (page_no=1) of the system tablespace
292 # all zeroes.
293 # restart
294 CHECK TABLE t1;
295 Table Op Msg_type Msg_text
296 test.t1 check status OK
297 SELECT f1, f2 FROM t1;
298 f1 f2
299 1 ############
300 2 ++++++++++++
301 3 ////////////
302 4 ------------
303 5 ............
304 7 ............
305 # Test End
306 # ---------------------------------------------------------------
307 DROP TABLE t1;