mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Merged following change from MySQL 5.6 to MariaDB 10.1 XtraDB
including the test case:
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
This commit is contained in:
parent
1512078a7a
commit
5534d81430
4 changed files with 63 additions and 16 deletions
1
mysql-test/suite/innodb/t/create_isl_with_direct.opt
Normal file
1
mysql-test/suite/innodb/t/create_isl_with_direct.opt
Normal file
|
|
@ -0,0 +1 @@
|
|||
--innodb_flush_method=O_DIRECT
|
||||
28
mysql-test/suite/innodb/t/create_isl_with_direct.test
Normal file
28
mysql-test/suite/innodb/t/create_isl_with_direct.test
Normal file
|
|
@ -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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue