Bug #33882 innodb_file_per_table must not be set for raw shared tablespace usage
Submitted: 16 Jan 2008 7:24 Modified: 16 Jan 2008 8:57
Reporter: Seva E Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.0.22-2.1 OS:Linux (RHEL 5 x86_64)
Assigned to: CPU Architecture:Any
Tags: innodb_data_home_dir, innodb_file_per_table, raw

[16 Jan 2008 7:24] Seva E
Description:
innodb_file_per_table must be set to 0 (default).  If it's set (to 1), InnoDB table data files (.ibd) will be created in the datadir instead of in the raw device's shared tablespace even if innodb_data_home_dir is blank.

Not sure if this is a bug or a feature, but this is not what I expected.  Tested with mysql-5.0.22-2.1 (RHEL 5).

How to repeat:
Create raw device:
 raw /dev/sda1 /dev/raw/raw1
 chown mysql /dev/raw/raw1

Configure my.cnf with:
 datadir=/var/lib/mysql
 innodb_file_per_table=1
 innodb_data_home_dir =
 innodb_data_file_path = /dev/raw/raw1:1Gnewraw

Restart mysqld to init new raw shared tablespace

Configure my.cnf with:
 datadir=/var/lib/mysql
 innodb_file_per_table=1
 innodb_data_home_dir =
 innodb_data_file_path = /dev/raw/raw1:1Graw

Restart mysqld to use new raw shared tablespace

 Create InnoDB table

Should be created in raw device's shared tablespace, actually created in datadir.

If innodb_file_per_table is set to 0, works as expected.

Suggested fix:
Either update documentation or ignore innodb_file_per_table if innodb_data_home_dir is blank
[16 Jan 2008 8:57] Valeriy Kravchuk
This is not a bug. Manual clearly says (http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces.html):

"InnoDB stores each newly created table into its own file tbl_name.ibd in the database directory where the table belongs."