Debian Codegraph @

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

raw
1 SHOW VARIABLES LIKE 'innodb_doublewrite';
2 Variable_name Value
3 innodb_doublewrite ON
4 SHOW VARIABLES LIKE 'innodb_fil_make_page_dirty_debug';
5 Variable_name Value
6 innodb_fil_make_page_dirty_debug 4294967295
7 SHOW VARIABLES LIKE 'innodb_saved_page_number_debug';
8 Variable_name Value
9 innodb_saved_page_number_debug 0
10 # Wait for purge to complete
11 create table t1 (f1 int primary key, f2 blob) engine=innodb STATS_PERSISTENT=0;
12 START TRANSACTION;
13 INSERT INTO t1 VALUES(1, repeat('#',12));
14 INSERT INTO t1 VALUES(2, repeat('+',12));
15 INSERT INTO t1 VALUES(3, repeat('/',12));
16 INSERT INTO t1 VALUES(4, repeat('-',12));
17 INSERT INTO t1 VALUES(5, repeat('.',12));
18 COMMIT WORK;
19 SET GLOBAL innodb_fast_shutdown = 0;
20 # Take backup of original datadir
21 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
22 # ---------------------------------------------------------------
23 # Test Begin: Test if recovery works if first page of user
24 # tablespace is full of zeroes.
25 SHOW VARIABLES LIKE 'innodb_doublewrite';
26 Variable_name Value
27 innodb_doublewrite DETECT_ONLY
28 # Ensure that dirty pages of table t1 is flushed.
29 FLUSH TABLES t1 FOR EXPORT;
30 UNLOCK TABLES;
31 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACEs
32 WHERE name = 'test/t1' INTO @space_id;
33 SET GLOBAL innodb_checkpoint_disabled=1;
34 SET GLOBAL innodb_limit_optimistic_insert_debug=2;
35 BEGIN;
36 INSERT INTO t1 VALUES (6, repeat('%', 12));
37 INSERT INTO t1 SELECT f1+8,f2 FROM t1;
38 SET GLOBAL innodb_checkpoint_disabled = 1;
39 # Make the first page dirty for table t1
40 SET GLOBAL innodb_saved_page_number_debug = 0;
41 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
42 ERROR HY000: Lost connection to MySQL server during query
43 # Make the first page (page_no=0) of the user tablespace
44 # full of zeroes.
45 # restoring original datadir
46 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
47 # Test End - 1
48 # ---------------------------------------------------------------
49 # Test Begin: Test if recovery works if first page of user
50 # tablespace is corrupted.
51 SHOW VARIABLES LIKE 'innodb_doublewrite';
52 Variable_name Value
53 innodb_doublewrite DETECT_ONLY
54 SELECT space from INFORMATION_SCHEMA.INNODB_TABLESPACES
55 WHERE name = 'test/t1' INTO @space_id;
56 # Ensure that dirty pages of table t1 is flushed.
57 FLUSH TABLES t1 FOR EXPORT;
58 UNLOCK TABLES;
59 SET GLOBAL innodb_checkpoint_disabled=1;
60 BEGIN;
61 INSERT INTO t1 VALUES (6, repeat('%', 12));
62 SET GLOBAL innodb_checkpoint_disabled = 1;
63 # Make the first page dirty for table t1
64 SET GLOBAL innodb_saved_page_number_debug = 0;
65 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
66 ERROR HY000: Lost connection to MySQL server during query
67 # Corrupt the first page (page_no=0) of the user tablespace.
68 # restoring original datadir
69 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
70 # Test End - 2
71 # ---------------------------------------------------------------
72 # Test Begin: Test if recovery works if 2nd page of user
73 # tablespace is full of zeroes.
74 SHOW VARIABLES LIKE 'innodb_doublewrite';
75 Variable_name Value
76 innodb_doublewrite DETECT_ONLY
77 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
78 WHERE name = 'test/t1' INTO @space_id;
79 # Ensure that dirty pages of table t1 is flushed.
80 FLUSH TABLES t1 FOR EXPORT;
81 UNLOCK TABLES;
82 SET GLOBAL innodb_checkpoint_disabled=1;
83 BEGIN;
84 INSERT INTO t1 VALUES (6, repeat('%', 400));
85 SET GLOBAL innodb_checkpoint_disabled = 1;
86 # Make the 2nd page dirty for table t1
87 SET GLOBAL innodb_saved_page_number_debug = 1;
88 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
89 ERROR HY000: Lost connection to MySQL server during query
90 # Make the 2nd page (page_no=1) of the tablespace all zeroes.
91 # restoring original datadir
92 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
93 # Test End - 3
94 # ---------------------------------------------------------------
95 # Test Begin: Test if recovery works if 2nd page of user
96 # tablespace is corrupted.
97 SHOW VARIABLES LIKE 'innodb_doublewrite';
98 Variable_name Value
99 innodb_doublewrite DETECT_ONLY
100 SELECT space FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
101 WHERE name = 'test/t1' into @space_id;
102 FLUSH TABLES t1 FOR EXPORT;
103 UNLOCK TABLES;
104 SET GLOBAL innodb_checkpoint_disabled=1;
105 BEGIN;
106 INSERT INTO t1 VALUES (6, repeat('%', 400));
107 # Make the 2nd page dirty for table t1
108 SET GLOBAL innodb_saved_page_number_debug = 1;
109 SET GLOBAL innodb_checkpoint_disabled = 1;
110 SET GLOBAL innodb_fil_make_page_dirty_debug = @space_id;
111 ERROR HY000: Lost connection to MySQL server during query
112 # Corrupt the 2nd page (page_no=1) of the user tablespace.
113 # restoring original datadir
114 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
115 # Test End - 4
116 # ---------------------------------------------------------------
117 # Test Begin: Test if recovery works if first page of
118 # system tablespace is full of zeroes.
119 SHOW VARIABLES LIKE 'innodb_doublewrite';
120 Variable_name Value
121 innodb_doublewrite DETECT_ONLY
122 SET GLOBAL innodb_master_thread_disabled_debug=1;
123 BEGIN;
124 INSERT INTO t1 VALUES (6, repeat('%', 400));
125 SET GLOBAL innodb_checkpoint_disabled = 1;
126 # Make the first page dirty for system tablespace
127 SET GLOBAL innodb_saved_page_number_debug = 0;
128 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
129 ERROR HY000: Lost connection to MySQL server during query
130 # Make the first page (page_no=0) of the system tablespace
131 # all zeroes.
132 # restoring original datadir
133 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
134 # Test End - 5
135 # ---------------------------------------------------------------
136 # Test Begin: Test if recovery works if first page of
137 # system tablespace is corrupted.
138 SHOW VARIABLES LIKE 'innodb_doublewrite';
139 Variable_name Value
140 innodb_doublewrite DETECT_ONLY
141 SET GLOBAL innodb_master_thread_disabled_debug=1;
142 BEGIN;
143 INSERT INTO t1 VALUES (6, repeat('%', 400));
144 SET GLOBAL innodb_checkpoint_disabled = 1;
145 # Make the first page dirty for system tablespace
146 SET GLOBAL innodb_saved_page_number_debug = 0;
147 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
148 ERROR HY000: Lost connection to MySQL server during query
149 # Corrupt the first page (page_no=0) of the system tablespace.
150 # restoring original datadir
151 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
152 # Test End - 6
153 # ---------------------------------------------------------------
154 # Test Begin: Test if recovery works if 2nd page of
155 # system tablespace is full of zeroes.
156 SHOW VARIABLES LIKE 'innodb_doublewrite';
157 Variable_name Value
158 innodb_doublewrite DETECT_ONLY
159 SET GLOBAL innodb_master_thread_disabled_debug=1;
160 BEGIN;
161 INSERT INTO t1 VALUES (6, repeat('%', 400));
162 SET GLOBAL innodb_checkpoint_disabled = 1;
163 # Make the second page dirty for system tablespace
164 SET GLOBAL innodb_saved_page_number_debug = 1;
165 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
166 ERROR HY000: Lost connection to MySQL server during query
167 # Make the 2nd page (page_no=1) of the system tablespace
168 # all zeroes.
169 # restoring original datadir
170 # restart: --innodb_doublewrite=detect_only --datadir=BACKUP/data
171 # Test End - 7
172 # ---------------------------------------------------------------
173 # Test Begin: Test if recovery works if 2nd page of
174 # system tablespace is corrupted.
175 SHOW VARIABLES LIKE 'innodb_doublewrite';
176 Variable_name Value
177 innodb_doublewrite DETECT_ONLY
178 SET GLOBAL innodb_master_thread_disabled_debug=1;
179 BEGIN;
180 INSERT INTO t1 VALUES (6, repeat('%', 400));
181 SET GLOBAL innodb_checkpoint_disabled = 1;
182 # Make the second page dirty for system tablespace
183 SET GLOBAL innodb_saved_page_number_debug = 1;
184 SET GLOBAL innodb_fil_make_page_dirty_debug = 0;
185 ERROR HY000: Lost connection to MySQL server during query
186 # Make the 2nd page (page_no=1) of the system tablespace
187 # all zeroes.
188 # restoring original datadir
189 # restart
190 # Test End - 8
191 # ---------------------------------------------------------------
192 DROP TABLE t1;