[MDEV-9362] InnoDB tables using DATA_DIRECTORY created using MySQL 5.6 do not work with MariaDB 10.1 Created: 2016-01-05  Updated: 2016-05-03  Resolved: 2016-05-03

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 10.1
Fix Version/s: 10.1.14

Type: Bug Priority: Critical
Reporter: Jan Lindström (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
includes MDEV-9581 [PATCH] Innodb in Mariadb-10.1.x is u... Closed
Sprint: 10.1.14

 Description   

Create a database using MySQL 5.6 server and create InnoDB table with DATA_DIRECTORY:

CREATE TABLE t1 (c1 INT PRIMARY KEY) DATA DIRECTORY = '/home/jan/mysql/db56/data2';
insert into t1 values (1),(2),(3);

Shutdown server (cleanly) and start MariaDB 10.1 server to same data directory. Table is not found:

MariaDB [test]> select * from t1;
ERROR 1932 (42S02): Table 'test.t1' doesn't exist in engine

Error log contains:

2016-01-05  9:11:08 140737288095488 [ERROR] InnoDB: Failed to find tablespace for table '"test"."t1"' in the cache. Attempting to load the tablespace with space id 6.
2016-01-05  9:11:08 140737288095488 [ERROR] InnoDB: In file '/home/jan/mysql/db56/data2/test/t1.ibd', tablespace id and flags are 6 and 1024, but in the InnoDB data dictionary they are 6 and 131072. Have you moved InnoDB .ibd files around without using the commands DISCARD TABLESPACE and IMPORT TABLESPACE? Please refer to http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2016-01-05 09:11:08 7ffff4104700  InnoDB: Operating system error number 2 in a file operation.  InnoDB: The error means the system cannot find the path specified.
2016-01-05  9:11:08 140737288095488 [ERROR] InnoDB: Could not find a valid tablespace file for 'test/t1'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.



 Comments   
Comment by Jan Lindström (Inactive) [ 2016-05-03 ]

commit 5dd0c77e9239217457cf795d6380bdd3bf0808ad
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Tue May 3 20:53:29 2016 +0300

MDEV-9362: InnoDB tables using DATA_DIRECTORY created using
MySQL 5.6 do not work with MariaDB 10.1

Analysis: Problem is that tablespace flags bit DATA_DIR
is on different position on MySQL 5.6 compared to
MariaDB 10.1.

Fix: If we detect that there is difference between dictionary
flags and tablespace flags we remove DATA_DIR flag and compare
again. Remote tablespace is tried to locate even in case
when DATA_DIR flag is not set.

Generated at Thu Feb 08 07:34:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.