File: mysql_57_inplace_upgrade.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (386 lines) | stat: -rw-r--r-- 16,592 bytes parent folder | download
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb_16k.inc
--source include/mysql_upgrade_preparation.inc
--source include/big_test.inc

--let $MYSQLD_DATADIR= `select @@datadir`
--echo # Set different paths for --datadir
--let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data57

--echo ###########################################################################
--echo # Stop the default mtr server
--echo ###########################################################################

--echo # Stop DB server which was created by MTR default
--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--echo ###########################################################################
--echo # Setup the 5.7 data directory
--echo ###########################################################################

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57.zip $MYSQL_TMP_DIR/data57.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--echo # These files are added to test error scenario, delete from for upgrade testing.
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.frm
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.MYD
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.MYI
--echo # Remove myisam partitioned tables. There are used for negative testing.
--remove_files_wildcard $MYSQL_TMP_DIR/data57/partitions *
--rmdir $MYSQL_TMP_DIR/data57/partitions
--force-rmdir $MYSQL_TMP_DIR/data57/mismatch_frms

--echo ###########################################################################
--echo # Test the --upgrade=NONE option with a 5.7 data directory
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_no_upgrade.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--error 1
--exec $MYSQLD --no-defaults --secure-file-priv="" --datadir=$MYSQLD_DATADIR1 --upgrade=NONE --log-error=$MYSQLD_LOG

--let SEARCH_FILE= $MYSQLD_LOG
--echo # Search for the error messege in the server error log.
--let SEARCH_PATTERN= Server shutting down because upgrade is required, yet prohibited by the command line option \'--upgrade=NONE\'\.
--source include/search_pattern.inc

--echo ###########################################################################
--echo # Test the --upgrade=MINIMAL option with a 5.7 data directory
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_skip_upgrade.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--exec echo "restart: --datadir=$MYSQLD_DATADIR1 --upgrade=MINIMAL  --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--let $wait_counter= 10000
--enable_reconnect
--source include/wait_until_connected_again.inc

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--let SEARCH_FILE= $MYSQLD_LOG
--echo # Search for the error messege in the server error log.

--let SEARCH_PATTERN= Table \'mysql.component\' doesn\'t exist
--source include/search_pattern.inc

--let SEARCH_PATTERN= The mysql\.component table is missing or has an incorrect definition\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.user\]
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.db\]\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.tables_priv\]\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.columns_priv\]\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.procs_priv\]\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Storage engine \'MyISAM\' does not support system tables\. \[mysql\.proxies_priv\]\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Column count of mysql\.user is wrong\. Expected 51, found 45\. The table is probably corrupted
--source include/search_pattern.inc

--let SEARCH_PATTERN= The current layout of the ACL tables does not conform to the server\'s expected layout
--source include/search_pattern.inc

--let SEARCH_PATTERN= ACL table mysql\.role_edges missing\. Some operations may fail\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= ACL table mysql\.default_roles missing\. Some operations may fail\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= ACL table mysql\.global_grants missing\. Some operations may fail\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= ACL table mysql\.password_history missing\. Some operations may fail\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= The system table mysql\.global_grants is missing. Please perform the MySQL upgrade procedure\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= System table \'func\' is expected to be transactional\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Info table is not ready to be used\. Table \'mysql.slave_master_info\' cannot be opened\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error in checking mysql\.slave_master_info repository info type of TABLE\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Error creating connection metadata\: Error checking repositories\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Replica: Failed to initialize the connection metadata structure for channel \'\'; its record may still be present in the applier metadata repository, consider deleting it\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Failed to create or recover replication info repositories\.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Server upgrade is required, but skipped by command line option \'--upgrade=MINIMAL\'\.
--source include/search_pattern.inc

--echo ###########################################################################
--echo # Test the --upgrade=NONE option with a 5.7 data directory with upgraded
--echo # data dictionary but skipped server upgrade
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_no_upgrade_after_skip.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--error 1
--exec $MYSQLD --no-defaults --secure-file-priv="" --datadir=$MYSQLD_DATADIR1 --upgrade=NONE --log-error=$MYSQLD_LOG

--let SEARCH_FILE= $MYSQLD_LOG
--echo # Search for the error messege in the server error log.
--let SEARCH_PATTERN= Server shutting down because upgrade is required, yet prohibited by the command line option \'--upgrade=NONE\'\.
--source include/search_pattern.inc

--echo ###########################################################################
--echo # Complete the upgrade on a data directory that has an upgraded data
--echo # dictionary but skipped server upgrade
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_upgrade_after_skip.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--exec echo "restart: --datadir=$MYSQLD_DATADIR1 --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--let $wait_counter= 10000
--enable_reconnect
--source include/wait_until_connected_again.inc

--echo # There should be no errors
--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= \[ERROR\]
--source include/search_pattern.inc

# It should have created a file in the MySQL Servers datadir
--let $MYSQLD_DATADIR= `select @@datadir`
--file_exists $MYSQLD_DATADIR/mysql_upgrade_info

--echo ###########################################################################
--echo # Test upgrade of help tables
--echo ###########################################################################

--echo # Truncate a help table
TRUNCATE TABLE mysql.help_topic;
SELECT COUNT(*) = 0 FROM mysql.help_topic;

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_upgrade_help_tables.log
--replace_result $MYSQLD_LOG MYSQLD_LOG
--let $restart_parameters = restart: --upgrade=FORCE --log-error=$MYSQLD_LOG
--let $wait_counter=10000
--source include/restart_mysqld.inc

SELECT COUNT(*) != 0 FROM mysql.help_topic;

--echo ###########################################################################
--echo # Cleanup
--echo ###########################################################################

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQL_TMP_DIR/data57
--remove_file $MYSQL_TMP_DIR/data57.zip

--echo ###########################################################################
--echo # Setup 5.7 data directory
--echo ###########################################################################

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/data57.zip $MYSQL_TMP_DIR/data57.zip

--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data57.zip

--echo # Unzip the zip file.
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--echo # These files are added to test error scenario, delete from for upgrade testing.
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.frm
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.MYD
--remove_file $MYSQL_TMP_DIR/data57/test/55_temporal.MYI
--echo # Remove myisam partitioned tables. There are used for negative testing.
--remove_files_wildcard $MYSQL_TMP_DIR/data57/partitions *
--rmdir $MYSQL_TMP_DIR/data57/partitions
--force-rmdir $MYSQL_TMP_DIR/data57/mismatch_frms

--echo ###########################################################################
--echo # Test complete upgrade on 5.7 data directory
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_upgrade_complete.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--exec echo "restart: --datadir=$MYSQLD_DATADIR1 --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--let $wait_counter= 10000
--enable_reconnect
--source include/wait_until_connected_again.inc

--echo # There should be no errors
--let SEARCH_FILE= $MYSQLD_LOG
# Server shutdown error can show up during high IO loads
--let IGNORE_PATTERN= \[ERROR\] \[[^]]*\] \[[^]]*\] Event Scheduler\: \[root@localhost\]\[events\.myevent\] (Unknown column \'c1\' in \'field list\'|Server shutdown in progress)
--let SEARCH_PATTERN= \[ERROR\]
--source include/search_pattern.inc

# It should have created a file in the MySQL Servers datadir
--let $MYSQLD_DATADIR= `select @@datadir`
--file_exists $MYSQLD_DATADIR/mysql_upgrade_info

--echo ###########################################################################
--echo # Bug#29365552: LEFTOVER SYSTEM TABLES AFTER 5.7 => 8.0 IN-PLACE UPGRADE
--echo ###########################################################################

# These files must not exist
# $MYSQLD_DATADIR1/mysql/innodb_index_stats_backup57.ibd
# $MYSQLD_DATADIR1/mysql/innodb_table_stats_backup57.ibd
--replace_regex /_[0-9]+\.sdi/_XXX.sdi/
--list_files $MYSQLD_DATADIR1/mysql

--echo ###########################################################################
--echo # Cleanup
--echo ###########################################################################

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/data57.zip

--echo ###########################################################################
--echo # Bug#29791350: NON-INSTALL IN-PLACE UPGRADE FAILING FROM 5.7.25 TO 8.0.16
--echo ###########################################################################

--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/bug29791350_upgrade_57022.zip $MYSQL_TMP_DIR/data57.zip
--file_exists $MYSQL_TMP_DIR/data57.zip
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql57_upgrade_bug29791350.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--exec echo "restart: --table-open-cache=256 --datadir=$MYSQLD_DATADIR1 --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--let $wait_counter= 10000
--enable_reconnect
--source include/wait_until_connected_again.inc

--echo ###########################################################################
--echo # Cleanup
--echo ###########################################################################

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/data57.zip

--echo ###########################################################################
--echo # Bug#29996434: 8.0.16 AUTO- UPGRADE CAPTURES WRONG AUTO_INCREMENT VALUES FOR TABLE METADATA
--echo ###########################################################################

--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/bug29996434_upgrade_57022.zip $MYSQL_TMP_DIR/data57.zip
--file_exists $MYSQL_TMP_DIR/data57.zip
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--let $restart_parameters = restart: --datadir=$MYSQLD_DATADIR1
--let $wait_counter= 10000
--source include/start_mysqld_no_echo.inc

SELECT table_name, Auto_increment FROM INFORMATION_SCHEMA.tables WHERE table_schema='test';

SHOW CREATE TABLE test.t1;
SHOW CREATE TABLE test.t2;
SHOW CREATE TABLE test.t3;

SELECT * FROM test.t1;
INSERT INTO test.t1 VALUES(NULL);
SELECT * FROM test.t1;

SELECT * FROM test.t2;
INSERT INTO test.t2 VALUES(NULL, 1);
SELECT * FROM test.t2;

SELECT * FROM test.t3;
INSERT INTO test.t3 VALUES(1, 1);
SELECT * FROM test.t3;

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/data57.zip

--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/bug29996434_upgrade_57022.zip $MYSQL_TMP_DIR/data57.zip
--file_exists $MYSQL_TMP_DIR/data57.zip
--exec unzip -qo $MYSQL_TMP_DIR/data57.zip -d $MYSQL_TMP_DIR

--let $restart_parameters = restart: --datadir=$MYSQLD_DATADIR1 --auto-increment-increment=10 --auto-increment-offset=5
--let $wait_counter= 10000
--source include/start_mysqld_no_echo.inc

SELECT table_name, Auto_increment FROM INFORMATION_SCHEMA.tables WHERE table_schema='test';

SHOW CREATE TABLE test.t1;
SHOW CREATE TABLE test.t2;
SHOW CREATE TABLE test.t3;

SELECT * FROM test.t1;
INSERT INTO test.t1 VALUES(NULL);
SELECT * FROM test.t1;

SELECT * FROM test.t2;
INSERT INTO test.t2 VALUES(NULL, 1);
SELECT * FROM test.t2;

SELECT * FROM test.t3;
INSERT INTO test.t3 VALUES(1, 1);
SELECT * FROM test.t3;

--echo ###########################################################################
--echo # Cleanup
--echo ###########################################################################

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/data57.zip

--echo ###########################################################################
--echo # BUG#33919635: 8.0 upgrade ( MS 5.6) crashes with Assertion failure: dict0dict.cc:1236:table2
--echo ###########################################################################

--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/datadir57.zip $MYSQL_TMP_DIR/datadir57.zip
--file_exists $MYSQL_TMP_DIR/datadir57.zip
--exec unzip -qo $MYSQL_TMP_DIR/datadir57.zip -d $MYSQL_TMP_DIR

--let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/datadir57

--let $restart_parameters = restart: --datadir=$MYSQLD_DATADIR1
--let $wait_counter= 10000
--source include/start_mysqld_no_echo.inc

--echo ###########################################################################
--echo # Cleanup
--echo ###########################################################################

--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--force-rmdir $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/datadir57.zip

 --let $restart_parameters = restart:
 --source include/start_mysqld.inc