select case when @@version like "5.7.30%" then '5730' when @@version like "8.0.20%" then '8020' else 'none' end as VERSION into @current_server_version; # Starting server with keyring plugin # restart: --early-plugin-load=keyring_file=keyring_file.so --loose-keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring --plugin-dir=KEYRING_PLUGIN_PATH CREATE DATABASE partitions; CREATE TABLE partitions.export1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; FLUSH TABLE partitions.export1 FOR EXPORT; UNLOCK TABLES; CREATE TABLE partitions.t1(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; ALTER TABLE partitions.t1 DISCARD PARTITION p0 TABLESPACE; CREATE TABLE partitions.t2(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; ALTER TABLE partitions.t2 DISCARD PARTITION p0, p1 TABLESPACE; ALTER TABLE partitions.t2 IMPORT PARTITION p0 TABLESPACE; ALTER TABLE partitions.t2 IMPORT PARTITION p1 TABLESPACE; CREATE TABLE partitions.t3(c1 INT,c2 INT) PARTITION BY KEY(c1) PARTITIONS 4; ALTER TABLE partitions.t3 DISCARD PARTITION p0, p1 TABLESPACE; ALTER TABLE partitions.t3 IMPORT PARTITION p1 TABLESPACE; CREATE TABLE partitions.export2 (c1 INT, c2 INT) PARTITION BY RANGE( c2) SUBPARTITION BY HASH( c2 ) SUBPARTITIONS 2 ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN MAXVALUE ); FLUSH TABLE partitions.export2 FOR EXPORT; UNLOCK TABLES; CREATE TABLE partitions.t4 (c1 INT, c2 INT) PARTITION BY RANGE( c2 ) SUBPARTITION BY HASH( c2 ) SUBPARTITIONS 2 ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN MAXVALUE ); ALTER TABLE partitions.t4 DISCARD PARTITION p0sp0 TABLESPACE; ALTER TABLE partitions.t4 DISCARD PARTITION p0sp1 TABLESPACE; ALTER TABLE partitions.t4 DISCARD PARTITION p1sp0 TABLESPACE; CREATE TABLE partitions.t5 (c1 INT, c2 INT) PARTITION BY RANGE( c2 ) SUBPARTITION BY HASH( c2 ) SUBPARTITIONS 2 ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN MAXVALUE ); ALTER TABLE partitions.t5 DISCARD PARTITION p0sp0 TABLESPACE; ALTER TABLE partitions.t5 DISCARD PARTITION p0sp1 TABLESPACE; ALTER TABLE partitions.t5 DISCARD PARTITION p1sp0 TABLESPACE; ALTER TABLE partitions.t5 DISCARD PARTITION p1sp1 TABLESPACE; ALTER TABLE partitions.t5 DISCARD PARTITION p2sp0 TABLESPACE; ALTER TABLE partitions.t5 IMPORT PARTITION p0sp0 TABLESPACE; ALTER TABLE partitions.t5 IMPORT PARTITION p0sp1 TABLESPACE; ALTER TABLE partitions.t5 IMPORT PARTITION p1sp0 TABLESPACE; ALTER TABLE partitions.t5 IMPORT PARTITION p2sp0 TABLESPACE; CREATE TABLE partitions.t6 (c1 INT, c2 INT) PARTITION BY RANGE( c2 ) SUBPARTITION BY HASH( c2 ) SUBPARTITIONS 2 ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN MAXVALUE ); ALTER TABLE partitions.t6 DISCARD PARTITION p0 TABLESPACE; ALTER TABLE partitions.t6 DISCARD PARTITION p1sp1 TABLESPACE; CREATE TABLE partitions.t7 (c1 INT, c2 INT) PARTITION BY RANGE( c2 ) SUBPARTITION BY HASH( c2 ) SUBPARTITIONS 2 ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30), PARTITION p3 VALUES LESS THAN MAXVALUE ); ALTER TABLE partitions.t7 DISCARD PARTITION p0 TABLESPACE; ALTER TABLE partitions.t7 DISCARD PARTITION p1sp0 TABLESPACE; ALTER TABLE partitions.t7 IMPORT PARTITION p0sp0 TABLESPACE; ALTER TABLE partitions.t7 IMPORT PARTITION p0sp1 TABLESPACE; ALTER TABLE partitions.t7 IMPORT PARTITION p1sp0 TABLESPACE; # Stop DB server which was created by MTR default # Copy and zip old version data directory. # Cleanup: Restart with default options. # restart DROP TABLE partitions.t1; DROP TABLE partitions.t2; DROP TABLE partitions.t3; DROP TABLE partitions.t4; DROP TABLE partitions.t5; DROP TABLE partitions.t6; DROP TABLE partitions.t7; DROP DATABASE partitions; call mtr.add_suppression("\\[Warning\\].* Tablespace .*, name '.*', file '.*' is missing"); call mtr.add_suppression("\\[Warning\\].* Tablespace for table `.*`\\.`.*` /\\* Partition `.*` \\*/ is set as discarded");