Debian Codegraph @

mysql-test/suite/innodb/include/partition_import.inc

raw
1 # WL 13352: Import partitioned tables from older version zip file
2 # Works for version 8.0.13, 8.0.15, 8.0.17, 8.0.19
3
4 # To Enable fixed path for external files
5 # --let $IS_FIXED_PATH = 1
6
7 --echo # Test to create schema for Upgrade in old version
8
9 --source include/have_innodb_16k.inc
10 --source include/no_valgrind_without_big.inc
11
12 # Check import across platforms for 8.0.19
13 if ($OLD_VERSION != 8019) {
14 --source include/have_case_sensitive_file_system.inc
15 --let $OLD_LCTN = 0
16 }
17
18 if ($OLD_LCTN == 0)
19 {
20 --source include/have_lowercase0.inc
21 }
22
23 if ($OLD_LCTN == 1)
24 {
25 --source include/have_lowercase1.inc
26 }
27
28 if ($OLD_LCTN == 2)
29 {
30 --source include/have_lowercase2.inc
31 }
32
33 --let $OLD_EXTN = $OLD_VERSION
34
35 # Check migration across platforms for 8.0.19
36 if ($OLD_VERSION == 8019)
37 {
38 --let $OLD_EXTN = `select concat("$OLD_VERSION", "_", "$OLD_PLATFORM", "_lctn_", "$OLD_LCTN")`
39 }
40
41 --let $MYSQLD_DATADIR= `select @@datadir`
42 --let $EXTERNAL_DIR_NAME= mysql_wl13352_data
43
44 # For manual upgrade testing with absolute path to match across setup
45 if ($IS_FIXED_PATH)
46 {
47 --let $EXTERNAL_DIRECTORY = /tmp/$EXTERNAL_DIR_NAME/
48 --let $UNZIP_DIR = /
49 }
50
51 if (!$IS_FIXED_PATH)
52 {
53 --let $EXTERNAL_DIRECTORY = $MYSQL_TMP_DIR/tmp/$EXTERNAL_DIR_NAME/
54 --let $UNZIP_DIR = $MYSQL_TMP_DIR
55 }
56
57 --let $EXPORT_DIRECTORY = $MYSQL_TMP_DIR/data_export
58 --mkdir $EXPORT_DIRECTORY
59
60 # Cleanup external directory
61 --error 0, 1
62 --force-rmdir $EXTERNAL_DIRECTORY
63
64 --echo # Extract data files to be imported
65 --copy_file $MYSQLTEST_VARDIR/std_data/upgrade/export_wl13352_$OLD_EXTN.zip $MYSQL_TMP_DIR/data_export.zip
66 --file_exists $MYSQL_TMP_DIR/data_export.zip
67 --exec unzip -qo $MYSQL_TMP_DIR/data_export.zip -d $UNZIP_DIR
68 --remove_file $MYSQL_TMP_DIR/data_export.zip
69
70 --echo # Starting server with keyring plugin
71 --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
72 --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/
73 --source include/restart_mysqld.inc
74
75 --echo
76 --echo # A. Create tables and fill data
77
78 --let $check_option = CREATE
79 --source suite/innodb/include/partition_upgrade_check.inc
80
81 --echo
82 --echo # Import table partitions
83 --let $check_option = IMPORT
84 --source suite/innodb/include/partition_upgrade_check.inc
85 --let $imported = 1
86
87 --echo
88 --echo # Check table metadata and data
89 --let $check_option = CHECK
90 --source suite/innodb/include/partition_upgrade_check.inc
91
92 --echo
93 --echo # Drop all tables created for import
94 --let $check_option = DROP
95 --source suite/innodb/include/partition_upgrade_check.inc
96
97 --echo
98 --echo # Stop DB server
99 --source include/shutdown_mysqld.inc
100
101 --echo # Cleanup: Restart with default options.
102 let $restart_parameters =;
103 --source include/start_mysqld.inc
104
105 --force-rmdir $EXTERNAL_DIRECTORY
106 --force-rmdir $EXPORT_DIRECTORY
107 if (!$IS_FIXED_PATH)
108 {
109 --force-rmdir $MYSQL_TMP_DIR/tmp
110 }
111 --remove_file $MYSQL_TMP_DIR/mysecret_keyring