Description:
When you try to import a tablespace from 5.6 into a 5.7 instance the error message is not helpful.
mysql [localhost] {msandbox} (test) > ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 1808 (HY000): Schema mismatch (Table flags don't match, server table has 0x4 and the meta-data file has 0x1)
From the error log:
2016-01-08T11:21:27.290646Z 2 [Note] InnoDB: Importing tablespace for table 'test/t1' that was exported from host 'dve-mac'
2016-01-08T11:21:27.290710Z 2 [Note] InnoDB: Discarding tablespace of table `test`.`t1`: Generic error
The issue here is that the table uses a different row_format on 5.7 by default. So using ROW_FORMAT=COMPACT in the create table solves this... but that's not obvious.
How to repeat:
mysql-5.6.25-log > use test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql-5.6.25-log > create table t1 (id int);
Query OK, 0 rows affected (0.04 sec)
mysql-5.6.25-log > INSERT INTO t1 values(1),(2),(3);
Query OK, 3 rows affected (0.01 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql-5.6.25-log > FLUSH TABLE t1 FOR EXPORT;
Query OK, 0 rows affected (0.00 sec)
mysql-5.6.25-log > show create table t1;
+-------+----------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
On 5.7.10:
mysql [localhost] {msandbox} (test) > CREATE TABLE `t1` ( `id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.04 sec)
mysql [localhost] {msandbox} (test) > ALTER TABLE t1 DISCARD TABLESPACE;
Query OK, 0 rows affected (0.01 sec)
Copy the .ibd and .cfg file
mysql [localhost] {msandbox} (test) > ALTER TABLE t1 IMPORT TABLESPACE;
ERROR 1808 (HY000): Schema mismatch (Table flags don't match, server table has 0x4 and the meta-data file has 0x1)
Suggested fix:
Give a text representation of InnoDB Flags like 0x1 0x36 etc.
Give a more detailed error than 'Generic error'