Bug #73513 different storage places with tables DATA DIRECTORY option
Submitted: 8 Aug 2014 21:44 Modified: 9 Sep 2014 13:55
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:mysql 5.6.20, 5.6.21 OS:Linux
Assigned to: Daniel Price CPU Architecture:Any

[8 Aug 2014 21:44] Hartmut Holzgraefe
Description:
When creating a table with DATA DIRECTORY option set
MyISAM will place table .MYD files in that directory
right away while InnoDB puts in an extra $database_name
subdir first.

InnoDB behavior is explained on 

  http://dev.mysql.com/doc/refman/5.6/en/tablespace-placing.html

but neither that page nor the CREATE TABLE Syntax page

  http://dev.mysql.com/doc/refman/5.6/en/create-table.html

mention that MyISAM and InnoDB behave differently in this respect

How to repeat:
Create MyISAM and InnoDB table with same DATA DIRECTORY,
check data directory contents and see that .MYD files are
in that directory right away why .ibd files are one subdir
level below, e.g.:

mysql> create table t_innodb(id int primary key) engine = innodb data directory = "/tmp/foobar";
Query OK, 0 rows affected (0.04 sec)

mysql> create table t_myisam(id int primary key) engine = myisam data directory = "/tmp/foobar";
Query OK, 0 rows affected (0.01 sec)

mysql> Bye

$ tree /tmp/foobar

/tmp/foobar
├── test
│   └── t_innodb.ibd
└── t_myisam.MYD

Suggested fix:
Mention the difference between the two engine more clearly ...
[11 Aug 2014 8:01] MySQL Verification Team
Hello Hartmut,

Thank you for the bug report and test case.
Verified as described.

Thanks,
Umesh
[11 Aug 2014 8:02] MySQL Verification Team
// 5.6.21

mysql> create table t_innodb(id int primary key) engine = innodb data directory = "/tmp/foobar";
Query OK, 0 rows affected (0.02 sec)

mysql> create table t_myisam(id int primary key) engine = myisam data directory = "/tmp/foobar";
Query OK, 0 rows affected (0.00 sec)

mysql> \q
Bye

[root@cluster-repo tmp]# tree /tmp/foobar
/tmp/foobar
├── test
│   └── t_innodb.ibd
└── t_myisam.MYD

1 directory, 2 files
[root@cluster-repo tmp]#
[9 Sep 2014 13:16] Daniel Price
Fixed as of the 5.6.15. 5.7.3 releases, and here's the changelog entry:

An implicit rollback caused the server to halt when restarting with an
"innodb_force_recovery" value of 3 or greater. This bug was addressed by
the combination of fixes for Bug #16310467 and Bug #17253499.

Thank you for the bug report.
[9 Sep 2014 13:18] Daniel Price
Please disregard the previous post. It was intended for a different bug.
[9 Sep 2014 13:55] Daniel Price
Revisions to the following pages have been committed:

http://dev.mysql.com/doc/refman/5.6/en/create-table.html
http://dev.mysql.com/doc/refman/5.7/en/create-table.html

The revised content should appear within 24 hours.

Thank you for the bug report.