# # Bug#30128418: IMPORT TABLESPACE MUST CHECK DESCENDING INDEX DEFINITION # ### ### EXPORT #1: Backup Ascending key IBD and v3 CFG ### # Create a table with a normal ascending secondary key and export it. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b)); INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (2, 2); SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Export the table using IB_EXPORT_CFG_VERSION_V3, # which does not export the DESC flag. SET GLOBAL DEBUG='+d,ib_export_use_cfg_version_3'; FLUSH TABLES t1 FOR EXPORT; SET GLOBAL DEBUG='-d,ib_export_use_cfg_version_3'; # Back-up the IBD and the v3 CFG file # Unlock the table, which deletes the CFG file. UNLOCK TABLES; ### ### EXPORT #2: Backup v4 CFG for Ascending key IBD ### # Export the table using IB_EXPORT_CFG_VERSION_V4, # which will export the DESC flag on the secondary index. FLUSH TABLES t1 FOR EXPORT; # Back-up the v4 CFG file UNLOCK TABLES; DROP TABLE t1; ### ### EXPORT #3: Backup Descending key IBD and v3 CFG ### # Create a table with a descending secondary key and export it. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b DESC)); INSERT INTO t1 VALUES (1, 1); INSERT INTO t1 VALUES (2, 2); SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b` DESC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Export the table using IB_EXPORT_CFG_VERSION_V3, # which does not export the DESC flag. SET GLOBAL DEBUG='+d,ib_export_use_cfg_version_3'; FLUSH TABLES t1 FOR EXPORT; SET GLOBAL DEBUG='-d,ib_export_use_cfg_version_3'; # Back-up the IBD and the v3 CFG file # Unlock the table, which deletes the CFG file. UNLOCK TABLES; ### ### EXPORT #4: Backup v4 CFG for Descending key IBD ### # Export the table using IB_EXPORT_CFG_VERSION_V4, # which will export the DESC flag on the secondary index. FLUSH TABLES t1 FOR EXPORT; # Back-up the v4 CFG with the descending key. # Unlock the table, which deletes the cfg file. UNLOCK TABLES; ### ### EXPORT #5: Backup with a future version 99 CFG ### # Export the table using a future version IB_EXPORT_CFG_VERSION_V99, SET GLOBAL DEBUG='+d,ib_export_use_cfg_version_99'; FLUSH TABLES t1 FOR EXPORT; SET GLOBAL DEBUG='-d,ib_export_use_cfg_version_99'; # Back-up the v99 CFG with the descending key. # Unlock the table, which deletes the cfg file. UNLOCK TABLES; ### ### IMPORT TEST #1: Ascending key IBD and v3 CFG to Discarded Ascending Key IBD ### # Recreate the table without the DESC attribute on the secondary key. DROP TABLE t1; CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the ascending key IBD and the v3 version of the CFG. # Import the table. Since both the discarded IBD and the imported # IBD match, the import succeeds. ALTER TABLE t1 IMPORT TABLESPACE; # Show that column b is sorted correctly. SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 INSERT INTO t1 VALUES (3, 3); INSERT INTO t1 VALUES (4, 4); SELECT * FROM t1; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by a; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by b; a b 1 1 2 2 3 3 4 4 DROP TABLE t1; ### ### IMPORT TEST #2: Ascending key IBD and v4 CFG to Discarded Ascending Key IBD ### # Recreate the table without the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the ascending key IBD and the v4 version of the CFG. # Import the table. Since both the discarded IBD and the imported # IBD match, the import succeeds. ALTER TABLE t1 IMPORT TABLESPACE; # Show that column b is sorted correctly. SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 INSERT INTO t1 VALUES (3, 3); INSERT INTO t1 VALUES (4, 4); SELECT * FROM t1; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by a; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by b; a b 1 1 2 2 3 3 4 4 DROP TABLE t1; ### ### IMPORT TEST #3: Ascending key IBD and v3 CFG to Discarded Descending Key IBD ### # Recreate the table with the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b DESC)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b` DESC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the ascending key IBD and the v3 version of the CFG. # Attempt to import the table. Since the DESC flag is not available in the # CFG file, we assume it is ascending, which is different from the exported # table. The error message will complain about Index b field b. # The import will abort and delete the cfg file. ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Index b field b is descending which does not match metadata file which is ascending) DROP TABLE t1; ### ### IMPORT TEST #4 Ascending key IBD and v4 CFG to Discarded Descending Key IBD ### # Recreate the table with the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b DESC)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b` DESC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the ascending key IBD and the v4 version of the CFG. # Attempt to import the table. Since the DESC flag if the discarded table # is different from the exported table, the error message will complain about # Index b field b. The import will abort and delete the cfg file. ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Index b field b is descending which does not match metadata file which is ascending) DROP TABLE t1; ### ### IMPORT TEST #5: Descending key IBD and v3 CFG to Discarded Ascending Key IBD ### # Recreate the table without the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the descending key IBD and the v3 version of the CFG. # Attempt to import the table. Since the DESC flag is not available in the # CFG file, we assume it is ascending, which matches the exported table. # So the import succeeds, but the sort order of the keys in the imported # file is descending and all new keys will be ascending. ALTER TABLE t1 IMPORT TABLESPACE; Warnings: Warning 1817 InnoDB: Index corrupt: Index 'b' is found to be corrupt and should be recreated. # Show that the index is corrupt SHOW WARNINGS; Level Code Message Warning 1817 InnoDB: Index corrupt: Index 'b' is found to be corrupt and should be recreated. CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check Warning InnoDB: Index b is marked as corrupted test.t1 check error Corrupt # Fix the corruption OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note Table does not support optimize, doing recreate + analyze instead test.t1 optimize status OK # Show that the index is no longer corrupt CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK # Show that column b is sorted consistently. SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 INSERT INTO t1 VALUES (3, 3); INSERT INTO t1 VALUES (4, 4); SELECT * FROM t1; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by a; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by b; a b 1 1 2 2 3 3 4 4 DROP TABLE t1; ### ### IMPORT TEST #6: Descending key IBD and v4 CFG to Discarded Ascending Key IBD ### # Recreate the table without the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the descending key IBD and the v4 version of the CFG. # Attempt to import the table. Since the DESC flag if the discarded table # is different from the exported table, the error message will complain about # column b in index b. The import will abort and delete the cfg file. ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Index b field b is ascending which does not match metadata file which is descending) DROP TABLE t1; ### ### IMPORT TEST #7: Descending key IBD and v3 CFG to Discarded Descending Key IBD ### # Recreate the table with the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b DESC)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b` DESC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the descending key IBD and the v3 version of the CFG. # Attempt to import the table. Since the DESC flag is not available in the # CFG file, we wrongly assume it is ascending. Since this is different from # the exported table, the error message will complain about column b in index b. ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Index b field b is descending which does not match metadata file which is ascending) DROP TABLE t1; ### ### IMPORT TEST #8: Descending key IBD and v4 CFG to Discarded Descending Key IBD ### # Recreate the table with the DESC attribute on the secondary key. CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY (b DESC)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int NOT NULL, `b` int DEFAULT NULL, PRIMARY KEY (`a`), KEY `b` (`b` DESC) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the descending key IBD and the v4 version of the CFG. # Import the table successfuly. ALTER TABLE t1 IMPORT TABLESPACE; # Show that column b is descending. SELECT * FROM t1; a b 1 1 2 2 SELECT * FROM t1 order by a; a b 1 1 2 2 SELECT * FROM t1 order by b; a b 1 1 2 2 INSERT INTO t1 VALUES (3, 3); INSERT INTO t1 VALUES (4, 4); SELECT * FROM t1; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by a; a b 1 1 2 2 3 3 4 4 SELECT * FROM t1 order by b; a b 1 1 2 2 3 3 4 4 ### ### IMPORT TEST #9: Any unknown version will be rejected with a clear error message. ### # Discard the table which deletes the IBD file. ALTER TABLE t1 DISCARD TABLESPACE; # Restore the descending key IBD and the v99 version of the CFG. # Attempt to import the table. ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Failed to import test/t1 because the CFG file version (99) is not compatible with the current version (5) SHOW WARNINGS; Level Code Message Error 3949 Failed to import test/t1 because the CFG file version (99) is not compatible with the current version (5) Warning 1816 InnoDB: ALTER TABLE `test`.`t1` IMPORT TABLESPACE failed with error 48 : 'Unsupported' Error 1112 Table 't1' uses an extension that doesn't exist in this MySQL version # Cleanup DROP TABLE t1; # # Bug#30191523 : FLUSH TABLE T FOR EXPORT OR ALTER TABLE T2 IMPORT # TABLESPACE BROKEN IN 8.0.17. # # ---------------------- Test 1 ---------------------------------- # Source table has INSTANT columns but target table doesn't # ---------------------------------------------------------------- # Create source table t1 and add a column INSTANTly CREATE TABLE t1(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY); ALTER TABLE t1 ADD COLUMN v1 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t1 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT; # Insert some data into t1 SELECT * from t1 limit 10; id v1 v2 1 aaaaaaaaaaaaa bbbbbbbbbbbbbb 2 aaaaaaaaaaaaa bbbbbbbbbbbbbb 3 aaaaaaaaaaaaa bbbbbbbbbbbbbb 4 aaaaaaaaaaaaa bbbbbbbbbbbbbb 5 aaaaaaaaaaaaa bbbbbbbbbbbbbb 6 aaaaaaaaaaaaa bbbbbbbbbbbbbb 7 aaaaaaaaaaaaa bbbbbbbbbbbbbb 8 aaaaaaaaaaaaa bbbbbbbbbbbbbb 9 aaaaaaaaaaaaa bbbbbbbbbbbbbb 10 aaaaaaaaaaaaa bbbbbbbbbbbbbb SELECT COUNT(*) from t1; COUNT(*) 1000 SELECT NAME, N_COLS, INSTANT_COLS FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME="test/t1"; NAME N_COLS INSTANT_COLS test/t1 6 0 SELECT NAME, POS, HAS_DEFAULT from information_Schema.innodb_columns WHERE NAME='v1' OR NAME='v2'; NAME POS HAS_DEFAULT v1 1 1 v2 2 1 # Flush the table and store CFG/IBD files to temp FLUSH TABLE t1 FOR EXPORT; UNLOCK TABLES; # Create table t2 without INSTANTly added columns CREATE TABLE t2 LIKE t1; ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should succeed. Target table metadata should have been updated. ALTER TABLE t2 IMPORT TABLESPACE; SELECT * from t2 limit 10; id v1 v2 1 aaaaaaaaaaaaa bbbbbbbbbbbbbb 2 aaaaaaaaaaaaa bbbbbbbbbbbbbb 3 aaaaaaaaaaaaa bbbbbbbbbbbbbb 4 aaaaaaaaaaaaa bbbbbbbbbbbbbb 5 aaaaaaaaaaaaa bbbbbbbbbbbbbb 6 aaaaaaaaaaaaa bbbbbbbbbbbbbb 7 aaaaaaaaaaaaa bbbbbbbbbbbbbb 8 aaaaaaaaaaaaa bbbbbbbbbbbbbb 9 aaaaaaaaaaaaa bbbbbbbbbbbbbb 10 aaaaaaaaaaaaa bbbbbbbbbbbbbb SELECT COUNT(*) from t2; COUNT(*) 1000 SELECT NAME, N_COLS, INSTANT_COLS FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME="test/t1" OR NAME="test/t2"; NAME N_COLS INSTANT_COLS test/t1 6 0 test/t2 6 0 SELECT NAME, POS, HAS_DEFAULT from information_Schema.innodb_columns WHERE NAME='v1' OR NAME='v2'; NAME POS HAS_DEFAULT v1 1 1 v2 2 1 v1 1 1 v2 2 1 DROP TABLE t2; # Create table t2 with one column added INSTANTly CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, v1 VARCHAR(255)); ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should fail as INSTANT METADATA doesn't match. ALTER TABLE t2 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (Table has instant column but current row version didn't match.) DROP TABLE t2; # Create table t2 with two column added INSTANTly CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY); ALTER TABLE t2 ADD COLUMN v1 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should succeed. ALTER TABLE t2 IMPORT TABLESPACE; SELECT * from t2 limit 10; id v1 v2 1 aaaaaaaaaaaaa bbbbbbbbbbbbbb 2 aaaaaaaaaaaaa bbbbbbbbbbbbbb 3 aaaaaaaaaaaaa bbbbbbbbbbbbbb 4 aaaaaaaaaaaaa bbbbbbbbbbbbbb 5 aaaaaaaaaaaaa bbbbbbbbbbbbbb 6 aaaaaaaaaaaaa bbbbbbbbbbbbbb 7 aaaaaaaaaaaaa bbbbbbbbbbbbbb 8 aaaaaaaaaaaaa bbbbbbbbbbbbbb 9 aaaaaaaaaaaaa bbbbbbbbbbbbbb 10 aaaaaaaaaaaaa bbbbbbbbbbbbbb SELECT COUNT(*) from t2; COUNT(*) 1000 SELECT NAME, N_COLS, INSTANT_COLS FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME="test/t1" OR NAME="test/t2"; NAME N_COLS INSTANT_COLS test/t1 6 0 test/t2 6 0 SELECT NAME, POS, HAS_DEFAULT from information_Schema.innodb_columns WHERE NAME='v1' OR NAME='v2'; NAME POS HAS_DEFAULT v1 1 1 v2 2 1 v1 1 1 v2 2 1 DROP TABLE t2; DROP TABLE t1; # ---------------------- Test 2 ---------------------------------- # Source table doesn't have INSTANT columns but target table does # ---------------------------------------------------------------- # Create source table t1 and add a column INSTANTly CREATE TABLE t1(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, v1 VARCHAR(255), v2 VARCHAR(255)); # Insert some data into t1 SELECT * from t1 limit 10; id v1 v2 1 aaaaaaaaaaaaa bbbbbbbbbbbbbb 2 aaaaaaaaaaaaa bbbbbbbbbbbbbb 3 aaaaaaaaaaaaa bbbbbbbbbbbbbb 4 aaaaaaaaaaaaa bbbbbbbbbbbbbb 5 aaaaaaaaaaaaa bbbbbbbbbbbbbb 6 aaaaaaaaaaaaa bbbbbbbbbbbbbb 7 aaaaaaaaaaaaa bbbbbbbbbbbbbb 8 aaaaaaaaaaaaa bbbbbbbbbbbbbb 9 aaaaaaaaaaaaa bbbbbbbbbbbbbb 10 aaaaaaaaaaaaa bbbbbbbbbbbbbb SELECT COUNT(*) from t1; COUNT(*) 1000 SELECT NAME, N_COLS, INSTANT_COLS FROM INFORMATION_SCHEMA.INNODB_TABLES WHERE NAME="test/t1"; NAME N_COLS INSTANT_COLS test/t1 6 0 SELECT NAME, POS, HAS_DEFAULT from information_Schema.innodb_columns WHERE NAME='v1' OR NAME='v2'; NAME POS HAS_DEFAULT v1 1 0 v2 2 0 # Flush the table and store CFG/IBD files to temp FLUSH TABLE t1 FOR EXPORT; UNLOCK TABLES; # Create table t2 with no INSTANTly added columns CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, v1 VARCHAR(255), v2 VARCHAR(255)); ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should succeed. ALTER TABLE t2 IMPORT TABLESPACE; DROP TABLE t2; # Create table t2 with 1 INSTANTly added columns CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, v1 VARCHAR(255)); ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should fail. ALTER TABLE t2 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (The .cfg file indicates no INSTANT column in the source table whereas the metadata in data dictionary says there are instant columns in the target table) DROP TABLE t2; # Create table t2 with 2 INSTANTly added columns CREATE TABLE t2(id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY); ALTER TABLE t2 ADD COLUMN v1 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 ADD COLUMN v2 VARCHAR(255), ALGORITHM=INSTANT; ALTER TABLE t2 DISCARD TABLESPACE; # Copy CFG/IBD file from temp # IMPORT should fail. ALTER TABLE t2 IMPORT TABLESPACE; ERROR HY000: Schema mismatch (The .cfg file indicates no INSTANT column in the source table whereas the metadata in data dictionary says there are instant columns in the target table) DROP TABLE t2; # Cleanup DROP TABLE t1;