set default_storage_engine=innodb; # # MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables # create table t2 (x int, z int default 41); alter table t2 discard tablespace; create table t1 (x int); insert into t1 values (1); alter table t1 add z int default 42, algorithm instant; select * from t1; x z 1 42 flush tables t1 for export; unlock tables; # The metadata has to be updated to instant ADD COLUMN. alter table t2 import tablespace; select * from t2; x z 1 42 insert into t2 set x=2; select * from t2; x z 1 42 2 41 alter table t1 discard tablespace; flush tables t2 for export; unlock tables; # Both the metadata and the data file used instant ADD COLUMN. alter table t1 import tablespace; select * from t1; x z 1 42 2 41 drop table t2; create table t2 select * from t1; alter table t1 discard tablespace; flush tables t2 for export; unlock tables; # The instant ADD COLUMN has to be removed from the metadata. alter table t1 import tablespace; select * from t1; x z 1 42 2 41 drop table t2; drop table t1;