WL#6867: Support transportable tablespaces for partitioned innodb tables
Affects: Server-Prototype Only — Status: Complete
Transportable tablespaces does not support partitioned tables, so one have to use EXCHANGE PARTITION WITH TABLE to be able to import/discard tablespaces for partitions/whole partitioned tables. This WL is to support: FLUSH TABLES partitioned_innodb_table FOR EXPORT; -- So it will flush all the partitions tablespaces and create .cfg files for each .ibd file. ALTER TABLE partitioned_innodb_table DISCARD TABLESPACE; -- Will remove all partitions .ibd files. ALTER TABLE partitioned_innodb_table IMPORT TABLESPACE; -- Will attach all partitions .ibd files. By supporting partitioned tables it will ease the backup procedure for partitioned innodb tables, and also make it possible for MEB to make use of Transportable Tablespaces (which is does for non partitioned innodb tables). Also it will allow copying tablespaces between instances. Using EXCHANGE PARTITION is not very practical when handling many partitions, this would increase the usability and remove the need of special treatment of partitioned innodb tables. Related bugs: BUG#70196: DISCARD/IMPORT tablespace is not supported for partitioned InnoDB tables BUG#71784: discard/import tablespace for partitioned table - Including a contribution that basically is the same code change for 5.6!
FR1: also partitioned tables will behave just as non partitioned tables for: ALTER TABLE t DISCARD TABLESPACE and ALTER TABLE t IMPORT TABLESPACE (Notice that the behavior is different for InnoDB vs other engines!)
To add support for this the following needs to be done: ha_partition::extra(HA_EXTRA_EXPORT) needs to be handled by forwarding the call to all partitions. (To support FLUSH TABLES FOR EXPORT.) ha_partition::discard_or_import_tablespace() needs to be implemented by forwarding the call to all partitions. + tests (use partitioned tables for the existing tests).
Copyright (c) 2000, 2021, Oracle Corporation and/or its affiliates. All rights reserved.