summaryrefslogtreecommitdiff
path: root/storage/innobase/os/os0file.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-08-01 14:56:18 +0200
committerSergei Golubchik <serg@mariadb.org>2015-08-01 14:56:18 +0200
commit6300f2f274bd9af0cdb599f15fbf55a66ba9ec56 (patch)
tree6db6b4551b60cdef01ea4732071bfcf3b35b6289 /storage/innobase/os/os0file.c
parent96badb16afcf8a6ae3d03918419fc51ace4be236 (diff)
parent830bcff0edd3dd031932e60c7a70fe92a63fc404 (diff)
downloadmariadb-git-6300f2f274bd9af0cdb599f15fbf55a66ba9ec56.tar.gz
Merge tag 'mysql-5.5.45' into 5.5
Diffstat (limited to 'storage/innobase/os/os0file.c')
-rw-r--r--storage/innobase/os/os0file.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 8fc22fbd119..d792e7a61d8 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -1,6 +1,6 @@
/***********************************************************************
-Copyright (c) 1995, 2010, Innobase Oy. All Rights Reserved.
+Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
@@ -1276,16 +1276,19 @@ os_file_create_simple_no_error_handling_func(
#else /* __WIN__ */
os_file_t file;
int create_flag;
+ const char* mode_str = NULL;
ut_a(name);
if (create_mode == OS_FILE_OPEN) {
+ mode_str = "OPEN";
if (access_type == OS_FILE_READ_ONLY) {
create_flag = O_RDONLY;
} else {
create_flag = O_RDWR;
}
} else if (create_mode == OS_FILE_CREATE) {
+ mode_str = "CREATE";
create_flag = O_RDWR | O_CREAT | O_EXCL;
} else {
create_flag = 0;
@@ -1310,6 +1313,14 @@ os_file_create_simple_no_error_handling_func(
#endif
} else {
*success = TRUE;
+
+ /* This function is always called for data files, we should
+ disable OS caching (O_DIRECT) here as we do in
+ os_file_create_func(), so we open the same file in the same
+ mode, see man page of open(2). */
+ if (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
+ os_file_set_nocache(file, name, mode_str);
+ }
}
return(file);