File: mysql_80_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 (187 lines) | stat: -rw-r--r-- 8,021 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
--source include/big_test.inc

--let $lctn= query_get_value(SHOW VARIABLES LIKE 'lower_case_table_names', Value, 1)

--let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_80011
--let $ZIP_FILE= $MYSQLTEST_VARDIR/std_data/upgrade/data_80011.zip
if ($lctn == 1)
{
  --let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_80011_ci
  --let $ZIP_FILE= $MYSQLTEST_VARDIR/std_data/upgrade/data_80011_ci_win.zip
}
if ($lctn == 2)
{
  --let $MYSQLD_DATADIR1= $MYSQL_TMP_DIR/data_80011_ci
  --let $ZIP_FILE= $MYSQLTEST_VARDIR/std_data/upgrade/data_80011_ci_mac.zip
}

--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_innodb_16k.inc
--source include/mysql_upgrade_preparation.inc

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

--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 8.0.11 data directory
--echo ###########################################################################

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $ZIP_FILE $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

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

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql80011_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 message 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 8.0.11 data directory
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql80011_skip_upgrade.log
--replace_result $MYSQLD MYSQLD $MYSQLD_DATADIR1 MYSQLD_DATADIR1 $MYSQLD_LOG MYSQLD_LOG
--exec echo "restart: --datadir=$MYSQLD_DATADIR1 --upgrade=MINIMAL --skip-grant-tables --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 message in the server error log.
--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 8.0.11 data directory with upgraded
--echo # data dictionary but skipped server upgrade
--echo ###########################################################################

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql80011_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 message 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/mysql80011_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/mysql80_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 $MYSQLD_DATADIR1
--remove_file $MYSQL_TMP_DIR/data_80011.zip

--echo ###########################################################################
--echo # Setup 8.0.11 data directory
--echo ###########################################################################

--echo # Copy the remote tablespace & DB zip files from suite location to working location.
--copy_file $ZIP_FILE $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

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

--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql80011_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
--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 # Stop DB server
--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc

--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/mysql_upgrade_cleanup.inc