Bug #66715 IMPORT TABLESPACE should work even if .cfg file is missing
Submitted: 5 Sep 2012 22:48 Modified: 18 Oct 2012 19:11
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.6.6 OS:Any
Assigned to: CPU Architecture:Any

[5 Sep 2012 22:48] Todd Farmer
Description:
The new transportable tablespaces for InnoDB in MySQL 5.6 require information from a .cfg file in order to restore data from a .ibd file with the ALTER TABLE ... IMPORT TABLESPACE command.  This is because data dictionary information is not stored in the .ibd file directly, and has to be exported out of the InnoDB system tablespace.  Based on testing, it seems the most critical information in the .cfg file is the data dictionary information - it is possible to use an ancient .cfg file with a more recent .ibd file, provided the table definition has not changed since the .cfg file was produced.

This limits usefulness for restoring InnoDB data when the system tablespace is corrupt or lost, and it would be great if ALTER TABLE ... IMPORT TABLESPACE would make a best effort to restore from the .ibd file when the .cfg file is missing.

How to repeat:
Try to do ALTER TABLE ... IMPORT TABLESPACE without a .cfg file.

Suggested fix:
Modify ALTER TABLE ... IMPORT TABLESPACE to make a best effort to restore from the .ibd file when the .cfg file is missing.
[18 Oct 2012 19:11] John Russell
Added to changelog for 5.6.8, 5.7.0: 

The InnoDB transportable tablespace feature was enhanced to allow
ALTER TABLE ... IMPORT TABLESPACE to succeed in some cases where the
corresponding .cfg file was not available. This enhancement allows
recovery of data even in some cases where the system tablespace is
corrupted or deleted.