File: 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 (192 lines) | stat: -rw-r--r-- 9,744 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
--source include/big_test.inc
--source include/have_debug.inc
--source include/not_valgrind.inc
--source include/have_case_sensitive_file_system.inc
--source include/mysql_upgrade_preparation.inc

--echo # This test upgrades schema from 5.7, 8.0 to 8.0.15 where we
--echo # introduce serveral ENCRYPTION control capabilities in MySQL
--echo # (WL#12261). Specifically this test upgrades from,
--echo #
--echo #   a) 5.7.25 where, we support file-per-tablespace
--echo #      encryption and not general tablespace encryption. We upgrade from
--echo #      FRM to DD.
--echo #   b) 8.0.12 where, we support file-per-tablespace
--echo #      encryption and not general tablespace encryption. We upgrade from
--echo #      DD to DD.
--echo #   c) 8.0.13 where, we support file-per-tablespace
--echo #      encryption and general tablespace encryption. We upgrade from
--echo #      DD to DD.
--echo #
--echo # The schema used is during upgrade is as described in
--echo # upgrade_schema.test placed in respective *.zip file. The expectation
--echo # is that the encryption clause for tables and tablespaces are
--echo # stored as designed by wl12261 after the upgrade is completed.. The
--echo # results are verified by querying the mysql.tables.options and
--echo # mysql.tablespaces.options.

--echo ########################################################################
--echo # Stop the running server.
--echo ########################################################################
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server 300
--source include/wait_until_disconnected.inc

--echo ########################################################################
--echo # Unzip a 5.7.25 datadir with bug data, start the server against it
--echo ########################################################################

--echo ########################################################################
--echo # Copy and unzip the datadir.
--echo ########################################################################
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/wl12261_upgrade_57025.zip $MYSQL_TMP_DIR/wl12261_upgrade_57025.zip
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_57025.zip
--exec unzip -qo $MYSQL_TMP_DIR/wl12261_upgrade_57025.zip -d $MYSQL_TMP_DIR
let $BUGDATA_57025_DATADIR = $MYSQL_TMP_DIR/data_57025;

--echo ########################################################################
--echo # Restart the server against the unzipped datadir.
--echo ########################################################################
let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/save_dd_upgrade_57025.log;
--exec echo "restart: --early-plugin-load=keyring_file=$KEYRING_PLUGIN --loose-keyring_file_data=$BUGDATA_57025_DATADIR/mysecret_keyring $KEYRING_PLUGIN_OPT --datadir=$BUGDATA_57025_DATADIR --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 10000
--source include/wait_until_connected_again.inc

--source include/mysql_upgrade_cleanup.inc

SET DEBUG='+d,skip_dd_table_access_check';
SELECT schema_id, t.name, t.options, t.tablespace_id
  FROM mysql.tables t JOIN mysql.schemata sch
       ON t.schema_id = sch.id WHERE sch.name LIKE 'db1' ORDER BY t.name;
SELECT id, name, options FROM mysql.tablespaces
  WHERE name LIKE 'ts%' OR name LIKE '%db1%';
SET DEBUG='-d,skip_dd_table_access_check';

--echo Check if upgrade root gets TABLE_ENCRYPTION_ADMIN privilege.
SHOW GRANTS FOR 'root'@'localhost';

--echo ########################################################################
--echo # Remove copied files and stop the server.
--echo ########################################################################
--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_57025.zip
--force-rmdir $MYSQL_TMP_DIR/data_57025
--remove_file $MYSQL_TMP_DIR/wl12261_upgrade_57025.zip

--echo ########################################################################
--echo # Unzip a 8.0.12 datadir with bug data, start the server against it
--echo ########################################################################

--echo ########################################################################
--echo # Copy and unzip the datadir.
--echo ########################################################################
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/wl12261_upgrade_80012.zip $MYSQL_TMP_DIR/wl12261_upgrade_80012.zip
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_80012.zip
--exec unzip -qo $MYSQL_TMP_DIR/wl12261_upgrade_80012.zip -d $MYSQL_TMP_DIR
let $BUGDATA_80012_DATADIR = $MYSQL_TMP_DIR/data_80012;

--echo ########################################################################
--echo # Restart the server against the unzipped datadir.
--echo ########################################################################
let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/save_dd_upgrade_80012.log;

--exec echo "restart: --early-plugin-load=keyring_file=$KEYRING_PLUGIN --loose-keyring_file_data=$BUGDATA_80012_DATADIR/mysecret_keyring $KEYRING_PLUGIN_OPT --datadir=$BUGDATA_80012_DATADIR --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 10000
--source include/wait_until_connected_again.inc

--source include/mysql_upgrade_cleanup.inc

SET DEBUG='+d,skip_dd_table_access_check';
SELECT schema_id, t.name, t.options, t.tablespace_id
  FROM mysql.tables t JOIN mysql.schemata sch
       ON t.schema_id = sch.id WHERE sch.name LIKE 'db1' ORDER BY t.name;
SELECT id, name, options FROM mysql.tablespaces
  WHERE name LIKE 'ts%' OR name LIKE '%db1%';
SET DEBUG='-d,skip_dd_table_access_check';

--echo Check if upgrade root gets TABLE_ENCRYPTION_ADMIN privilege.
SHOW GRANTS FOR 'root'@'localhost';

--echo ########################################################################
--echo # Remove copied files and stop the server.
--echo ########################################################################
--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_80012.zip
--force-rmdir $MYSQL_TMP_DIR/data_80012
--remove_file $MYSQL_TMP_DIR/wl12261_upgrade_80012.zip

--echo ########################################################################
--echo # Unzip a 8.0.13 datadir with bug data, start the server against it
--echo ########################################################################

--echo ########################################################################
--echo # Copy and unzip the datadir.
--echo ########################################################################
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/wl12261_upgrade_80013.zip $MYSQL_TMP_DIR/wl12261_upgrade_80013.zip
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_80013.zip
--exec unzip -qo $MYSQL_TMP_DIR/wl12261_upgrade_80013.zip -d $MYSQL_TMP_DIR
let $BUGDATA_80013_DATADIR = $MYSQL_TMP_DIR/data_80013;

--echo ########################################################################
--echo # Restart the server against the unzipped datadir.
--echo ########################################################################
let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/save_dd_upgrade_80013.log;
--exec echo "restart: --early-plugin-load=keyring_file=$KEYRING_PLUGIN --loose-keyring_file_data=$BUGDATA_80013_DATADIR/mysecret_keyring $KEYRING_PLUGIN_OPT --datadir=$BUGDATA_80013_DATADIR --log-error=$MYSQLD_LOG" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--let $wait_counter= 10000
--source include/wait_until_connected_again.inc

--source include/mysql_upgrade_cleanup.inc

SET DEBUG='+d,skip_dd_table_access_check';
SELECT schema_id, t.name, t.options, t.tablespace_id
  FROM mysql.tables t JOIN mysql.schemata sch
       ON t.schema_id = sch.id WHERE sch.name LIKE 'db1' ORDER BY t.name;
SELECT id, name, options FROM mysql.tablespaces
  WHERE name LIKE 'ts%' OR name LIKE '%db1%';
SET DEBUG='-d,skip_dd_table_access_check';

--echo Check if upgrade root gets TABLE_ENCRYPTION_ADMIN privilege.
SHOW GRANTS FOR 'root'@'localhost';

--echo ########################################################################
--echo # Remove copied files and stop the server.
--echo ########################################################################
--let $shutdown_server_timeout = 300
--source include/shutdown_mysqld.inc
--file_exists $MYSQL_TMP_DIR/wl12261_upgrade_80013.zip
--force-rmdir $MYSQL_TMP_DIR/data_80013
--remove_file $MYSQL_TMP_DIR/wl12261_upgrade_80013.zip

--echo ########################################################################
--echo # Cleanup: Restart with default options.
--echo ########################################################################
let $restart_parameters =;
--source include/start_mysqld.inc

--echo ########################################################################
--echo # Bug #29447073: UPGRADE FROM 8.0.16 TO TRUNK FAILS WHEN MYSQL TABLESPACE IS ENCRYPTED
--echo ########################################################################

alter tablespace mysql encryption='Y';

--replace_result $KEYRING_PLUGIN_OPT KEYRING_PLUGIN_OPT
--let $restart_parameters = restart: --upgrade=FORCE --early-plugin-load=keyring_file=$KEYRING_PLUGIN $KEYRING_PLUGIN_OPT
--let $wait_counter=10000
--source include/restart_mysqld.inc
--source include/wait_until_connected_again.inc

--source include/mysql_upgrade_cleanup.inc

alter tablespace mysql encryption='N';

--echo ########################################################################
--echo # Cleanup: Restart with default options.
--echo ########################################################################
let $restart_parameters =;
--source include/restart_mysqld.inc