File: mysql_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 (113 lines) | stat: -rw-r--r-- 4,452 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
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb_16k.inc

--let $MYSQLD_DATADIR= `select @@datadir`

--echo ###########################################################################
--echo # Test check and repair
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql_upgrade_test_1.log

CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1 (a INT) ENGINE=MYISAM;
--remove_file $MYSQLD_DATADIR/db1/t1.MYI
--write_file $MYSQLD_DATADIR/db1/t1.MYI
EOF

--replace_result $MYSQLD_LOG MYSQLD_LOG $MYSQLD MYSQLD
--let $restart_parameters = restart: --upgrade=FORCE --debug="+d,force_fix_user_schemas" --log-error=$MYSQLD_LOG
--let $wait_counter=10000
--source include/restart_mysqld.inc

--let SEARCH_FILE= $MYSQLD_LOG

--let SEARCH_PATTERN= Table 'db1.t1' requires repair.
--source include/search_pattern.inc

--let SEARCH_PATTERN= Table 'db1.t1' repair failed.
--source include/search_pattern.inc

--remove_file $MYSQLD_LOG

DROP DATABASE db1;
DROP DATABASE db2;

--let $restart_parameters = restart:
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info

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

--echo # Stop DB server which was created by MTR default
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 300
--source include/wait_until_disconnected.inc

--echo ###########################################################################
--echo # Setup 8.0 data dir
--echo ###########################################################################

--echo # Set different paths for --datadir
--let $MYSQLD_DATADIR1 = $MYSQL_TMP_DIR/data_80011
--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/data_80011.zip $MYSQL_TMP_DIR/data_80011.zip
--echo # Check that the file exists in the working folder.
--file_exists $MYSQL_TMP_DIR/data_80011.zip

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

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql_upgrade_test.log
--replace_result $MYSQLD_LOG MYSQLD_LOG $MYSQLD MYSQLD

--echo ###########################################################################
--echo # Abort server startup if upgrade is pending
--echo ###########################################################################

--error 1
--exec $MYSQLD --no-defaults --secure-file-priv="" --datadir=$MYSQLD_DATADIR1 --upgrade=MINIMAL --log-error=$MYSQLD_LOG --debug="+d,simulate_mysql_upgrade_skip_pending"

--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= Server upgrade started with version \\d+, but server upgrade of version \\d+ is still pending\.
--source include/search_pattern.inc
--remove_file $MYSQLD_LOG

--error 1
--exec $MYSQLD --no-defaults --secure-file-priv="" --datadir=$MYSQLD_DATADIR1 --log-error=$MYSQLD_LOG --debug="+d,simulate_mysql_upgrade_skip_pending"

--let SEARCH_FILE= $MYSQLD_LOG
--let SEARCH_PATTERN= Server upgrade started with version \\d+, but server upgrade of version \\d+ is still pending\.
--source include/search_pattern.inc
--remove_file $MYSQLD_LOG

--echo ###########################################################################
--echo # Test default upgrade option
--echo ###########################################################################

--let HELP_OUTPUT_LOG= $MYSQLTEST_VARDIR/log/mysql_upgrade_help.log
--let HELP_OUTPUT_ERR= $MYSQLTEST_VARDIR/log/mysql_upgrade_help.err
--error 1
--exec $MYSQLD --upgrade --help --verbose > $HELP_OUTPUT_LOG 2>$HELP_OUTPUT_ERR
--let SEARCH_FILE= $HELP_OUTPUT_LOG
--let SEARCH_PATTERN= upgrade\\s+AUTO
--source include/search_pattern.inc
--let SEARCH_FILE= $HELP_OUTPUT_ERR
--let SEARCH_PATTERN = option \'--upgrade\' requires an argument\.
--source include/search_pattern.inc
--remove_file $HELP_OUTPUT_ERR
--remove_file $HELP_OUTPUT_LOG

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

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

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