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
|
########################################################################
#
# This test will first verify the DD schema of the currently running
# server, and dump the SHOW CREATE statements for the DD tables to
# a file. Then, it will unzip a data dirctory from version 5.7,
# estart the server to make it do upgrade, and verify that the DD tables
# after upgrade are similar to those that are created when initializing
# the target server.
#
# The zipped 5.7 data directory can be restored on any file system.
# There is a corresponding test for upgrade after 8.0.
#
########################################################################
########################################################################
# Assert target schema ids.
########################################################################
########################################################################
# Verify the hard coded ids of the mysql schema, the mysql tablespace,
# the dd_properties table, and the innodb_dynamic_metadata table.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The id of the mysql schema must be fixed.
########################################################################
include/assert.inc [The id of the 'mysql' schema is 1.]
########################################################################
# The ids of the mysql tablespace must be fixed.
########################################################################
include/assert.inc [The id of the 'mysql' tablespace is 1.]
include/assert.inc [The SE private id of the 'mysql' tablespace is 4294967294.]
########################################################################
# The ids of the dd_properties table must be fixed.
########################################################################
include/assert.inc [The id of 'mysql.dd_properties' is 1.]
include/assert.inc [The SE private id of 'mysql.dd_properties' is 1.]
include/assert.inc [The clustering index id of 'mysql.dd_properties' is 1.]
########################################################################
# The ids of the innodb_dynamic_metadata table must be fixed.
########################################################################
include/assert.inc [The id of 'mysql.innodb_dynamic_metadata' is 2.]
include/assert.inc [The SE private id of 'mysql.innodb_dynamic_metadata' is 2.]
include/assert.inc [The index id of 'mysql.innodb_dynamic_metadata' is 2.]
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Assert target schema table names.
########################################################################
########################################################################
# Verify the existence of the expected DD tables, neither less nor more.
# Fill two help tables with the DD and DDSE table names.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The number of hidden DD/DDSE tables must be as expected.
########################################################################
include/assert.inc [There are 32 hidden DD/DDSE tables.]
include/assert.inc [There are 34 DD/DDSE tables in total.]
########################################################################
# No unexpected DD tables must be present.
########################################################################
include/assert.inc [No unexpected DD tables are present.]
########################################################################
# All expected DD tables must be present.
########################################################################
include/assert.inc [All expected DD tables are present.]
########################################################################
# All expected DDSE tables must be present.
########################################################################
include/assert.inc [All expected DDSE are be present.]
DROP TABLE test.ddse_table_names;
DROP TABLE test.dd_table_names;
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Dump DD table definitions to file.
########################################################################
########################################################################
# Verify the DD_VERSION and the CREATE TABLE statements of the
# DD tables.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The actual DD version stored on disk.
########################################################################
########################################################################
# List the CREATE TABLE statements for the DD tables.
# Mask the AUTO INCREMENT counter, which is not
# deterministic when running mtr. Mask collations that
# depend on the lower case table names setting.
########################################################################
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Dump mysql.dd_properties to file.
########################################################################
set debug='+d,skip_dd_table_access_check';
SELECT * FROM mysql.dd_properties INTO OUTFILE 'MYSQL_TMP_DIR/target_dd_properties.txt';
set debug='-d,skip_dd_table_access_check';
########################################################################
# Stop the running server.
########################################################################
########################################################################
# Test upgrade from 57022.
########################################################################
########################################################################
# Unzip a 57022 datadir, start the server against it and prepare a
# file containing the DD table definitions after upgrade.
########################################################################
########################################################################
# Copy and unzip the datadir.
########################################################################
########################################################################
# Restart the server against the unzipped datadir.
########################################################################
# restart: --datadir=MYSQLD_DATADIR_UPGRADE --log-error-verbosity=3 --log-error=MYSQLD_LOG
########################################################################
# Verify that we can restart after upgrade.
########################################################################
# restart: --datadir=MYSQLD_DATADIR_UPGRADE --log-error-verbosity=3 --log-error=MYSQLD_LOG
########################################################################
# Target schema ids for an upgrade from 57022 should hold.
########################################################################
########################################################################
# Verify the hard coded ids of the mysql schema, the mysql tablespace,
# the dd_properties table, and the innodb_dynamic_metadata table.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The id of the mysql schema must be fixed.
########################################################################
include/assert.inc [The id of the 'mysql' schema is 1.]
########################################################################
# The ids of the mysql tablespace must be fixed.
########################################################################
include/assert.inc [The id of the 'mysql' tablespace is 1.]
include/assert.inc [The SE private id of the 'mysql' tablespace is 4294967294.]
########################################################################
# The ids of the dd_properties table must be fixed.
########################################################################
include/assert.inc [The id of 'mysql.dd_properties' is 1.]
include/assert.inc [The SE private id of 'mysql.dd_properties' is 1.]
include/assert.inc [The clustering index id of 'mysql.dd_properties' is 1.]
########################################################################
# The ids of the innodb_dynamic_metadata table must be fixed.
########################################################################
include/assert.inc [The id of 'mysql.innodb_dynamic_metadata' is 2.]
include/assert.inc [The SE private id of 'mysql.innodb_dynamic_metadata' is 2.]
include/assert.inc [The index id of 'mysql.innodb_dynamic_metadata' is 2.]
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Assert actual schema table names after upgrade.
########################################################################
########################################################################
# Verify the existence of the expected DD tables, neither less nor more.
# Fill two help tables with the DD and DDSE table names.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The number of hidden DD/DDSE tables must be as expected.
########################################################################
include/assert.inc [There are 32 hidden DD/DDSE tables.]
include/assert.inc [There are 34 DD/DDSE tables in total.]
########################################################################
# No unexpected DD tables must be present.
########################################################################
include/assert.inc [No unexpected DD tables are present.]
########################################################################
# All expected DD tables must be present.
########################################################################
include/assert.inc [All expected DD tables are present.]
########################################################################
# All expected DDSE tables must be present.
########################################################################
include/assert.inc [All expected DDSE are be present.]
DROP TABLE test.ddse_table_names;
DROP TABLE test.dd_table_names;
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Dump actual DD table definitions after upgrade to file and
# compare to target.
########################################################################
########################################################################
# Verify the DD_VERSION and the CREATE TABLE statements of the
# DD tables.
########################################################################
SET debug = '+d,skip_dd_table_access_check';
########################################################################
# The actual DD version stored on disk.
########################################################################
########################################################################
# List the CREATE TABLE statements for the DD tables.
# Mask the AUTO INCREMENT counter, which is not
# deterministic when running mtr. Mask collations that
# depend on the lower case table names setting.
########################################################################
SET debug = '-d,skip_dd_table_access_check';
########################################################################
# Dump actual DD table properties after upgrade to file and
# compare to target.
########################################################################
set debug='+d,skip_dd_table_access_check';
SELECT * FROM mysql.dd_properties INTO OUTFILE 'MYSQL_TMP_DIR/actual_dd_properties.txt';
set debug='-d,skip_dd_table_access_check';
########################################################################
# Remove copied files and stop the server.
########################################################################
########################################################################
# Cleanup: Remove definition files and restart with default options.
########################################################################
# restart
|