Debian Codegraph @

mysql-test/suite/innodb/include/ddl_crash_statement.inc

raw
1
2 let $get_create_template=1;
3 let $final_table_name = $table_name;
4 # Test for FREE TREE
5 if ($test_free)
6 {
7 let $crash_count=1;
8 let $did_crash=1;
9 while ($did_crash)
10 {
11 --eval $create_statement
12 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
13 eval SET SESSION DEBUG = '+d,ddl_log_crash_before_free_tree_log_$crash_count';
14 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
15 eval SET SESSION DEBUG = '-d,ddl_log_crash_before_free_tree_log_$crash_count';
16 --eval DROP TABLE $table_name
17 inc $crash_count;
18 }
19
20 let $crash_count=1;
21 let $did_crash=1;
22 while ($did_crash)
23 {
24 --eval $create_statement
25 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
26 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_free_tree_log_$crash_count';
27 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
28 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_free_tree_log_$crash_count';
29 --eval DROP TABLE $table_name
30 inc $crash_count;
31 }
32
33 let $crash_count=1;
34 let $did_crash=1;
35 while ($did_crash)
36 {
37 --eval $create_statement
38 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
39 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_free_tree_delete_$crash_count';
40 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
41 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_free_tree_delete_$crash_count';
42 --eval DROP TABLE $table_name
43 inc $crash_count;
44 }
45 }
46
47 # Test for DELETE SPACE
48 if ($test_delete)
49 {
50 let $crash_count=1;
51 let $did_crash=1;
52 while ($did_crash)
53 {
54 --eval $create_statement
55 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
56 eval SET SESSION DEBUG = '+d,ddl_log_crash_before_delete_space_log_$crash_count';
57 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
58 eval SET SESSION DEBUG = '-d,ddl_log_crash_before_delete_space_log_$crash_count';
59 --eval DROP TABLE $table_name
60 inc $crash_count;
61 }
62
63 let $crash_count=1;
64 let $did_crash=1;
65 while ($did_crash)
66 {
67 --eval $create_statement
68 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
69 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_delete_space_log_$crash_count';
70 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
71 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_delete_space_log_$crash_count';
72 --eval DROP TABLE $table_name
73 inc $crash_count;
74 }
75
76 let $crash_count=1;
77 let $did_crash=1;
78 while ($did_crash)
79 {
80 --eval $create_statement
81 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
82 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_delete_space_delete_$crash_count';
83 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
84 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_delete_space_delete_$crash_count';
85 --eval DROP TABLE $table_name
86 inc $crash_count;
87 }
88 }
89
90 # Test for RENAME SPACE
91 if ($test_rename)
92 {
93 let $crash_count=1;
94 let $did_crash=1;
95 while ($did_crash)
96 {
97 --eval $create_statement
98 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
99 eval SET SESSION DEBUG = '+d,ddl_log_crash_before_rename_space_log_$crash_count';
100 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
101 eval SET SESSION DEBUG = '-d,ddl_log_crash_before_rename_space_log_$crash_count';
102 let $drop_table_name = $table_name;
103 if ($rename_flag)
104 {
105 if ($did_crash == 0)
106 {
107 let $drop_table_name = $rename_table_name;
108 }
109 }
110 --eval DROP TABLE $drop_table_name
111 inc $crash_count;
112 }
113
114 let $crash_count=1;
115 let $did_crash=1;
116 while ($did_crash)
117 {
118 --eval $create_statement
119 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
120 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_rename_space_log_$crash_count';
121 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
122 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_rename_space_log_$crash_count';
123 let $drop_table_name = $table_name;
124 if ($rename_flag)
125 {
126 if ($did_crash == 0)
127 {
128 let $drop_table_name = $rename_table_name;
129 }
130 }
131 --eval DROP TABLE $drop_table_name
132 inc $crash_count;
133 }
134
135 let $crash_count=1;
136 let $did_crash=1;
137 while ($did_crash)
138 {
139 --eval $create_statement
140 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
141 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_rename_space_delete_$crash_count';
142 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
143 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_rename_space_delete_$crash_count';
144 let $drop_table_name = $table_name;
145 if ($rename_flag)
146 {
147 if ($did_crash == 0)
148 {
149 let $drop_table_name = $rename_table_name;
150 }
151 }
152 --eval DROP TABLE $drop_table_name
153 inc $crash_count;
154 }
155 }
156
157
158 # Test for DROP
159 if ($test_drop)
160 {
161 let $crash_count=1;
162 let $did_crash=1;
163 while ($did_crash)
164 {
165 --eval $create_statement
166 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
167 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_drop_log_$crash_count';
168 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
169 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_drop_log_$crash_count';
170 --eval DROP TABLE $table_name
171 inc $crash_count;
172 }
173 }
174
175 # Get the table definition
176 --disable_query_log
177 --disable_result_log
178
179 --eval $create_statement
180 --eval $insert_statement
181 --eval SELECT * FROM $table_name LIMIT 1
182 --eval $crash_statement
183 if ($rename_flag)
184 {
185 let $final_table_name = $rename_table_name;
186 }
187 let $create_template= query_get_value(SHOW CREATE TABLE $final_table_name, Create Table, 1);
188 --eval DROP TABLE $final_table_name
189
190 --enable_result_log
191 --enable_query_log
192
193 let $get_create_template=0;
194
195
196 # Test for POST DDL
197 --eval $create_statement
198 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
199 eval SET SESSION DEBUG = '+d,ddl_log_before_post_ddl';
200 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
201 eval SET SESSION DEBUG = '-d,ddl_log_before_post_ddl';
202 --eval DROP TABLE $final_table_name
203
204 # Test for REPLAY
205 let $crash_count=1;
206 let $did_crash=1;
207 while ($did_crash)
208 {
209 --eval $create_statement
210 SET GLOBAL innodb_ddl_log_crash_reset_debug = 1;
211 eval SET SESSION DEBUG = '+d,ddl_log_crash_after_replay_$crash_count';
212 --source ../mysql-test/suite/innodb/include/ddl_crash.inc
213 eval SET SESSION DEBUG = '-d,ddl_log_crash_after_replay_$crash_count';
214 --eval DROP TABLE $final_table_name
215 inc $crash_count;
216 }