Bug #112188 Fail to import tablespace after upgrade
Submitted: 26 Aug 2023 12:28 Modified: 17 Jan 2024 13:26
Reporter: Cai Minshen Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.32 OS:Any
Assigned to: CPU Architecture:Any

[26 Aug 2023 12:28] Cai Minshen
Description:
Upgrade from MySQL V5.7 to V8.0. Then it fails to import tablespace.  The error is the below:
ERROR 1808 (HY000): Schema mismatch (Clustered index validation failed. Because the .cfg file is missing, table definition of the IBD file could be different. Or the data file itself is already corrupted.) 

How to repeat:
1) Create a MySQL V5.7.43 instance. 
2) Create a table.
create database test00;
create table test00.t0 (id int primary key, name varchar(20));

3) Upgrade the instance to MySQL V8.0.32
4) Shut down the instance gracefully. Copy test00/t0.idb file for backup. 
5) Start the MySQL again;
6) Discard tablespace test00.t0
alter table test00.t0 discard tablespace;
7) Copy backup t0.idb to the directory test00 again.
8) Import the tablespace for test00.t0, then it fails.
alter table test00.t0 import tablespace;
ERROR 1808 (HY000): Schema mismatch (Clustered index validation failed. Because the .cfg file is missing, table definition of the IBD file could be different. Or the data file itself is already corrupted.)
[17 Dec 2023 13:26] MySQL Verification Team
Hello Cai Vincent,

Thank you for the report and feedback.
My apologies, somehow lost track of this bug.
I think you should copy not just .ibd buth both t0.{ibd,cfg}. Could you please follow the steps from https://dev.mysql.com/doc/refman/8.0/en/innodb-table-import.html and confirm you are still experiencing the issue? Thank you.

regards,
Umesh
[18 Jan 2024 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".