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
|
# WL 13352: Import partitioned tables from older version zip file
# Works for version 8.0.13, 8.0.15, 8.0.17, 8.0.19
# To Enable fixed path for external files
# --let $IS_FIXED_PATH = 1
--echo # Test to create schema for Upgrade in old version
--source include/have_innodb_16k.inc
--source include/no_valgrind_without_big.inc
# Check import across platforms for 8.0.19
if ($OLD_VERSION != 8019) {
--source include/have_case_sensitive_file_system.inc
--let $OLD_LCTN = 0
}
if ($OLD_LCTN == 0)
{
--source include/have_lowercase0.inc
}
if ($OLD_LCTN == 1)
{
--source include/have_lowercase1.inc
}
if ($OLD_LCTN == 2)
{
--source include/have_lowercase2.inc
}
--let $OLD_EXTN = $OLD_VERSION
# Check migration across platforms for 8.0.19
if ($OLD_VERSION == 8019)
{
--let $OLD_EXTN = `select concat("$OLD_VERSION", "_", "$OLD_PLATFORM", "_lctn_", "$OLD_LCTN")`
}
--let $MYSQLD_DATADIR= `select @@datadir`
--let $EXTERNAL_DIR_NAME= mysql_wl13352_data
# For manual upgrade testing with absolute path to match across setup
if ($IS_FIXED_PATH)
{
--let $EXTERNAL_DIRECTORY = /tmp/$EXTERNAL_DIR_NAME/
--let $UNZIP_DIR = /
}
if (!$IS_FIXED_PATH)
{
--let $EXTERNAL_DIRECTORY = $MYSQL_TMP_DIR/tmp/$EXTERNAL_DIR_NAME/
--let $UNZIP_DIR = $MYSQL_TMP_DIR
}
--let $EXPORT_DIRECTORY = $MYSQL_TMP_DIR/data_export
--mkdir $EXPORT_DIRECTORY
# Cleanup external directory
--error 0, 1
--force-rmdir $EXTERNAL_DIRECTORY
--echo # Extract data files to be imported
--copy_file $MYSQLTEST_VARDIR/std_data/upgrade/export_wl13352_$OLD_EXTN.zip $MYSQL_TMP_DIR/data_export.zip
--file_exists $MYSQL_TMP_DIR/data_export.zip
--exec unzip -qo $MYSQL_TMP_DIR/data_export.zip -d $UNZIP_DIR
--remove_file $MYSQL_TMP_DIR/data_export.zip
--echo # Starting server with keyring plugin
--let $restart_parameters = restart: --innodb_directories=$EXTERNAL_DIRECTORY --early-plugin-load="keyring_file=$KEYRING_PLUGIN" --loose-keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring $KEYRING_PLUGIN_OPT
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN_OPT --plugin-dir=KEYRING_PLUGIN_PATH $KEYRING_PLUGIN keyring_file.so $EXTERNAL_DIRECTORY /tmp/mysql_wl13352_data/
--source include/restart_mysqld.inc
--echo
--echo # A. Create tables and fill data
--let $check_option = CREATE
--source suite/innodb/include/partition_upgrade_check.inc
--echo
--echo # Import table partitions
--let $check_option = IMPORT
--source suite/innodb/include/partition_upgrade_check.inc
--let $imported = 1
--echo
--echo # Check table metadata and data
--let $check_option = CHECK
--source suite/innodb/include/partition_upgrade_check.inc
--echo
--echo # Drop all tables created for import
--let $check_option = DROP
--source suite/innodb/include/partition_upgrade_check.inc
--echo
--echo # Stop DB server
--source include/shutdown_mysqld.inc
--echo # Cleanup: Restart with default options.
let $restart_parameters =;
--source include/start_mysqld.inc
--force-rmdir $EXTERNAL_DIRECTORY
--force-rmdir $EXPORT_DIRECTORY
if (!$IS_FIXED_PATH)
{
--force-rmdir $MYSQL_TMP_DIR/tmp
}
--remove_file $MYSQL_TMP_DIR/mysecret_keyring
|