summaryrefslogtreecommitdiff
path: root/storage/innobase/fsp
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 14:25:36 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 14:25:36 +0300
commite5c4f4e590d7782ef938b436f84ae11b68e0af08 (patch)
tree7919303321a6e4663340a75dd56aa4ef55e3ef4f /storage/innobase/fsp
parent3bb36e949534fc4a24d68d4297663ae8b80ba336 (diff)
parent0ee1082bd2e7e7049c4f0e686bad53cf7ba053ab (diff)
downloadmariadb-git-e5c4f4e590d7782ef938b436f84ae11b68e0af08.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/fsp')
-rw-r--r--storage/innobase/fsp/fsp0sysspace.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc
index 98b3ae38097..5fcf8ea4e51 100644
--- a/storage/innobase/fsp/fsp0sysspace.cc
+++ b/storage/innobase/fsp/fsp0sysspace.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2016, 2021, MariaDB Corporation.
+Copyright (c) 2016, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -445,12 +445,27 @@ SysTablespace::create_file(
case SRV_NOT_RAW:
err = file.open_or_create(
- m_ignore_read_only ? false : srv_read_only_mode);
+ !m_ignore_read_only && srv_read_only_mode);
break;
}
+ if (err != DB_SUCCESS) {
+ return err;
+ }
- if (err == DB_SUCCESS && file.m_type != SRV_OLD_RAW) {
+ switch (file.m_type) {
+ case SRV_OLD_RAW:
+ break;
+ case SRV_NOT_RAW:
+#ifndef _WIN32
+ if (!space_id() && my_disable_locking
+ && os_file_lock(file.m_handle, file.m_filepath)) {
+ err = DB_ERROR;
+ break;
+ }
+#endif
+ /* fall through */
+ case SRV_NEW_RAW:
err = set_size(file);
}
@@ -491,7 +506,7 @@ SysTablespace::open_file(
case SRV_NOT_RAW:
err = file.open_or_create(
- m_ignore_read_only ? false : srv_read_only_mode);
+ !m_ignore_read_only && srv_read_only_mode);
if (err != DB_SUCCESS) {
return(err);
@@ -506,6 +521,14 @@ SysTablespace::open_file(
break;
case SRV_NOT_RAW:
+#ifndef _WIN32
+ if (!space_id() && (m_ignore_read_only || !srv_read_only_mode)
+ && my_disable_locking
+ && os_file_lock(file.m_handle, file.m_filepath)) {
+ err = DB_ERROR;
+ break;
+ }
+#endif
/* Check file size for existing file. */
err = check_size(file);
break;