Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged following change from MySQL 5.6 to MariaDB 10.1 XtraDB
including the test case: mysql/mysql-server@520aedfe INNODB: "DATA DIRECTORY" OPTION OF CREATE TABLE FAILS WITH PWRITE() OS ERROR 22 Fix for version mysql-5.6 PROBLEM ======== For version mysql-5.6.27 onwards InnoDB fails to create a table with explicit 'data directory' option when Innodb_flush_method is set to O_DIRECT.While creating link file we get a a pwrite error 22 due to the alignment restrictions imposed by O_DIRECT flag which is being set for the link file created. FIX === Fixed the above issue by making use of file IO functions while creating the link file that wouldn't let the O_DIRECT flag restrictions arise. Reviewed-by: Kevin Lewis <kevin.lewis@oracle.com> Reviewed-by: Shaohua Wang <shaohua.wang@oracle.com> RB: 11387
- Loading branch information
Jan Lindström
committed
May 6, 2016
1 parent
1512078
commit 5534d81
Showing
4 changed files
with
63 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SHOW VARIABLES LIKE 'innodb_flush_method'; | ||
Variable_name Value | ||
innodb_flush_method O_DIRECT | ||
CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='MYSQL_TMP_DIR'; | ||
# Contents of tmp/test directory containing .ibd file | ||
t1.ibd | ||
# Contents of the 'test' database directory containing .isl and .frm files | ||
t1.frm | ||
t1.isl | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--innodb_flush_method=O_DIRECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--source include/not_embedded.inc | ||
--source include/have_innodb.inc | ||
--source include/not_windows.inc | ||
|
||
--disable_query_log | ||
CALL mtr.add_suppression("\\[Warning\\] InnoDB: Failed to set O_DIRECT on file ./ibdata1: OPEN: Invalid argument, continuing anyway. O_DIRECT is known to result in 'Invalid argument' on Linux on tmpfs, see MySQL Bug#26662."); | ||
|
||
# The below mtr suppression to avoid failure in solaris platform. | ||
CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*"); | ||
--enable_query_log | ||
|
||
SHOW VARIABLES LIKE 'innodb_flush_method'; | ||
|
||
let MYSQLD_DATADIR=`SELECT @@datadir`; | ||
|
||
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR | ||
|
||
# Create a table with explicit data directory option. | ||
EVAL CREATE TABLE t1 (x INT) ENGINE=INNODB, DATA DIRECTORY='$MYSQL_TMP_DIR'; | ||
|
||
--echo # Contents of tmp/test directory containing .ibd file | ||
--list_files $MYSQL_TMP_DIR/test | ||
|
||
--echo # Contents of the 'test' database directory containing .isl and .frm files | ||
--list_files $MYSQLD_DATADIR/test | ||
|
||
DROP TABLE t1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters