Debian Codegraph @

mysql-test/suite/innodb/t/log_file.test

raw
1 --echo # Testcase for the following bugs
2 --echo # Bug#16691130 - ASSERT WHEN INNODB_LOG_GROUP_HOME_DIR DOES NOT EXIST
3 --echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES
4
5 --source include/have_innodb.inc
6 --source include/no_valgrind_without_big.inc
7
8 --disable_query_log
9 call mtr.add_suppression("InnoDB: Could not create undo tablespace.*undo002");
10 call mtr.add_suppression("InnoDB: InnoDB Database creation was aborted");
11 call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
12 call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
13 call mtr.add_suppression("InnoDB: Operating system error number \d+ in a file operation");
14 call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
15 call mtr.add_suppression("InnoDB: File /path/to/non-existent/ib_logfile101 was not found");
16 call mtr.add_suppression("InnoDB: Cannot create .path.to.non-existent.ib_logfile101");
17 call mtr.add_suppression("InnoDB: The data file '.*ibdata1' was not found but one of the other data files '.*ibdata2' exists");
18 call mtr.add_suppression("InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages");
19 call mtr.add_suppression("InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing");
20 call mtr.add_suppression("InnoDB: undo tablespace '.*undo001' exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.");
21 call mtr.add_suppression("");
22 call mtr.add_suppression("");
23 --enable_query_log
24
25 let bugdir= $MYSQLTEST_VARDIR/tmp/log_file;
26 --mkdir $bugdir
27
28 let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
29 let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
30 WHERE engine = 'innodb'
31 AND support IN ('YES', 'DEFAULT', 'ENABLED');
32
33 let $check_yes_innodb=SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
34 WHERE engine='innodb'
35 AND support IN ('YES', 'DEFAULT', 'ENABLED');
36
37 --let $ibp=--innodb-log-group-home-dir=$bugdir
38 --let $ibp=$ibp --innodb-data-home-dir=$bugdir --innodb-undo-directory=$bugdir
39 --let $ibp=$ibp --innodb-undo-logs=20 --innodb-undo-tablespaces=3
40 --let $ibp=$ibp --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
41
42 --echo # Start mysqld without the possibility to create innodb_undo_tablespaces
43 --let $restart_parameters= $ibp
44 --mkdir $bugdir/undo002
45 --source include/restart_mysqld.inc
46 eval $check_no_innodb;
47 --source include/shutdown_mysqld.inc
48
49 let SEARCH_PATTERN=\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002';
50 --source include/search_pattern_in_file.inc
51
52 --echo # Remove undo001,undo002,ibdata1,ibdata2,ib_logfile101
53 --remove_file $bugdir/undo001
54 --rmdir $bugdir/undo002
55 --remove_file $bugdir/ibdata1
56 --remove_file $bugdir/ibdata2
57 --remove_file $bugdir/ib_logfile101
58 --list_files $bugdir
59
60 --echo # Start mysqld with non existent innodb_log_group_home_dir
61 --let $restart_parameters= $ibp --innodb_log_group_home_dir=/path/to/non-existent/
62 --source include/start_mysqld.inc
63 eval $check_no_innodb;
64 --source include/shutdown_mysqld.inc
65 let SEARCH_PATTERN=Cannot create /path/to/non-existent/ib_logfile101;
66 --source include/search_pattern_in_file.inc
67
68 --list_files $bugdir
69
70 --echo # Successfully let InnoDB create tablespaces
71 --let $restart_parameters= $ibp
72 --source include/start_mysqld.inc
73 eval $check_yes_innodb;
74 --source include/shutdown_mysqld.inc
75
76 --echo # Backup tmp/logfile/*
77 --copy_file $bugdir/ibdata1 $bugdir/bak_ibdata1
78 --copy_file $bugdir/ibdata2 $bugdir/bak_ibdata2
79 --copy_file $bugdir/ib_logfile0 $bugdir/bak_ib_logfile0
80 --copy_file $bugdir/undo001 $bugdir/bak_undo001
81 --copy_file $bugdir/undo002 $bugdir/bak_undo002
82 --copy_file $bugdir/undo003 $bugdir/bak_undo003
83
84 --echo # 1. With ibdata2, Without ibdata1
85 --remove_file $bugdir/ibdata1
86
87 --source include/start_mysqld.inc
88 eval $check_no_innodb;
89 --source include/shutdown_mysqld.inc
90 let SEARCH_PATTERN=The data file '.*ibdata1' was not found but one of the other data files '.*ibdata2' exists;
91 --source include/search_pattern_in_file.inc
92
93 # clean up & Restore
94 --source ../include/log_file_cleanup.inc
95
96 --echo # 2. With ibdata1, without ibdata2
97 --remove_file $bugdir/ibdata2
98 --source include/start_mysqld.inc
99 eval $check_no_innodb;
100 --source include/shutdown_mysqld.inc
101 let SEARCH_PATTERN=InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages;
102 --source include/search_pattern_in_file.inc
103 let SEARCH_PATTERN=InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing;
104 --source include/search_pattern_in_file.inc
105
106 # clean up & Restore
107 --source ../include/log_file_cleanup.inc
108
109 --echo # 3. Without ibdata1 & ibdata2
110 --remove_file $bugdir/ibdata1
111 --remove_file $bugdir/ibdata2
112 --list_files $bugdir
113 --source include/start_mysqld.inc
114 eval $check_no_innodb;
115 --source include/shutdown_mysqld.inc
116 let SEARCH_PATTERN=InnoDB: undo tablespace .*undo001.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.;
117 --source include/search_pattern_in_file.inc
118
119 # clean up & Restore
120 --source ../include/log_file_cleanup.inc
121
122 --echo # 4. Without ibdata*, ib_logfile* and with undo00*
123 --remove_files_wildcard $bugdir ibdata*
124 --remove_files_wildcard $bugdir ib_logfile*
125 --list_files $bugdir
126 --source include/start_mysqld.inc
127 eval $check_no_innodb;
128 --source include/shutdown_mysqld.inc
129
130 # clean up & Restore
131 --source ../include/log_file_cleanup.inc
132
133 --echo # 5. Without ibdata*,ib_logfile* files & Without undo002
134 --remove_files_wildcard $bugdir ibdata*
135 --remove_files_wildcard $bugdir ib_logfile*
136 --remove_file $bugdir/undo002
137 --list_files $bugdir
138 --source include/start_mysqld.inc
139 eval $check_no_innodb;
140 --source include/shutdown_mysqld.inc
141
142 # clean up & Restore
143 --source ../include/log_file_cleanup.inc
144
145 --echo # 6. Without ibdata*,ib_logfile* files & Without undo001, undo002
146 # and with undo003
147 --remove_files_wildcard $bugdir ibdata*
148 --remove_files_wildcard $bugdir ib_logfile*
149 --remove_file $bugdir/undo001
150 --remove_file $bugdir/undo002
151 --list_files $bugdir
152 --source include/start_mysqld.inc
153 eval $check_no_innodb;
154 --source include/shutdown_mysqld.inc
155 let SEARCH_PATTERN=undo tablespace .*undo003.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\.;
156 --source include/search_pattern_in_file.inc
157
158 # clean up & Restore
159 --source ../include/log_file_cleanup.inc
160
161 --echo # 7. With ibdata files & Without undo002
162 --remove_file $bugdir/undo002
163 --list_files $bugdir
164 --source include/start_mysqld.inc
165 eval $check_no_innodb;
166 --source include/shutdown_mysqld.inc
167 let SEARCH_PATTERN=InnoDB: Failed to open the undo tablespace;
168 --source include/search_pattern_in_file.inc
169 # clean up & Restore
170 --source ../include/log_file_cleanup.inc
171
172 --echo # 8. With ibdata files & Without undo001, undo002
173 --remove_file $bugdir/undo001
174 --remove_file $bugdir/undo002
175 --list_files $bugdir
176 --source include/start_mysqld.inc
177 eval $check_no_innodb;
178 --source include/shutdown_mysqld.inc
179 let SEARCH_PATTERN=InnoDB: Failed to open the undo tablespace;
180 --source include/search_pattern_in_file.inc
181
182 # clean up & Restore
183 --source ../include/log_file_cleanup.inc
184
185 --echo # 9. Without ibdata*, without undo*
186 --remove_files_wildcard $bugdir ibdata*
187 --remove_files_wildcard $bugdir undo00*
188 --list_files $bugdir
189 --source include/start_mysqld.inc
190 eval $check_no_innodb;
191 --source include/shutdown_mysqld.inc
192 let SEARCH_PATTERN=redo log file .*ib_logfile0.* exists\. Creating system tablespace with existing redo log file is not recommended\. Please delete redo log file before creating new system tablespace\.;
193 --source include/search_pattern_in_file.inc
194
195 # clean up & Restore
196 --source ../include/log_file_cleanup.inc
197
198 --echo # 10. With ibdata*, without ib_logfile0
199 --remove_file $bugdir/ib_logfile0
200
201 --source include/start_mysqld.inc
202 eval $check_no_innodb;
203 --source include/shutdown_mysqld.inc
204
205 --source ../include/log_file_cleanup.inc
206
207 --echo # 11. With ibdata*
208 --list_files $bugdir
209 --source include/start_mysqld.inc
210 eval $check_yes_innodb;
211 --source include/shutdown_mysqld.inc
212
213 --let $restart_parameters=--innodb-log-write-ahead-size=513
214 --source include/start_mysqld.inc
215 eval $check_no_innodb;
216 --source include/shutdown_mysqld.inc
217
218 --let $restart_parameters=--innodb-log-write-ahead-size=4095
219 --source include/start_mysqld.inc
220 eval $check_no_innodb;
221 --source include/shutdown_mysqld.inc
222
223 # this will be silently truncated to the maximum
224 --let $restart_parameters=--innodb-log-write-ahead-size=10000
225 --source include/start_mysqld.inc
226 SELECT @@innodb_log_write_ahead_size;
227
228 --echo # Cleanup
229 --list_files $bugdir
230 --remove_files_wildcard $bugdir
231 --rmdir $bugdir