| 1 |
# Testcase used to create DB with partitioned Tables which have |
| 2 |
# some partitions discarded. |
| 3 |
# |
| 4 |
# It uses include/discarded_partition.inc to fill in tables, so |
| 5 |
# the results, after upgrade should be the same |
| 6 |
# |
| 7 |
# Note: to use in 5.7, you have to: |
| 8 |
# a) change "#p#" to "#P#" in discarded_partition.inc |
| 9 |
# b) change "#sp" to "#SP" in discarded_partition.inc |
| 10 |
# |
| 11 |
|
| 12 |
--source include/linux.inc |
| 13 |
--source include/have_case_sensitive_file_system.inc |
| 14 |
--source include/have_innodb_16k.inc |
| 15 |
|
| 16 |
--let $MYSQLD_DATADIR= `select @@datadir` |
| 17 |
|
| 18 |
select case when @@version like "5.7.30%" then '5730' |
| 19 |
when @@version like "8.0.20%" then '8020' |
| 20 |
else 'none' end as VERSION into @current_server_version; |
| 21 |
|
| 22 |
--let $VERSION= `select @current_server_version` |
| 23 |
--let $IS_57= `select case when @@version like "5.7%" then 1 else 0 end` |
| 24 |
|
| 25 |
--echo # Starting server with keyring plugin |
| 26 |
--let $restart_parameters = restart: --early-plugin-load="keyring_file=$KEYRING_PLUGIN" --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring $KEYRING_PLUGIN_OPT |
| 27 |
|
| 28 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH $KEYRING_PLUGIN keyring_file.so |
| 29 |
--source include/restart_mysqld.inc |
| 30 |
|
| 31 |
# Prepare database |
| 32 |
--let $discarded_partition_option = PREPARE |
| 33 |
--source suite/innodb/include/discarded_partition.inc |
| 34 |
|
| 35 |
--echo |
| 36 |
--echo # Stop DB server which was created by MTR default |
| 37 |
--source include/shutdown_mysqld.inc |
| 38 |
|
| 39 |
if ($IS_57) |
| 40 |
{ |
| 41 |
--mkdir $MYSQLTEST_VARDIR/std_data/upgrade |
| 42 |
} |
| 43 |
|
| 44 |
# Zip data directory and copy |
| 45 |
--echo # Copy and zip old version data directory. |
| 46 |
--exec ln -s $MYSQLD_DATADIR $MYSQLTEST_VARDIR/data_upgrade |
| 47 |
--exec zip -qr $MYSQL_TMP_DIR/data_upgrade.zip $MYSQLTEST_VARDIR/data_upgrade |
| 48 |
--file_exists $MYSQL_TMP_DIR/data_upgrade.zip |
| 49 |
--move_file $MYSQL_TMP_DIR/data_upgrade.zip $MYSQLTEST_VARDIR/std_data/upgrade/discarded_partition_data_$VERSION.zip.new |
| 50 |
--remove_file $MYSQLTEST_VARDIR/data_upgrade |
| 51 |
|
| 52 |
|
| 53 |
--echo # Cleanup: Restart with default options. |
| 54 |
let $restart_parameters =; |
| 55 |
--source include/start_mysqld.inc |
| 56 |
|
| 57 |
# Clean up |
| 58 |
--let $discarded_partition_option = DROP_TEST |
| 59 |
--source suite/innodb/include/discarded_partition.inc |
| 60 |
|
| 61 |
|
| 62 |
--remove_file $MYSQL_TMP_DIR/mysecret_keyring |
| 63 |
|
| 64 |
call mtr.add_suppression("\\[Warning\\].* Tablespace .*, name '.*', file '.*' is missing"); |
| 65 |
call mtr.add_suppression("\\[Warning\\].* Tablespace for table `.*`\\.`.*` /\\* Partition `.*` \\*/ is set as discarded"); |