summaryrefslogtreecommitdiff
path: root/storage/innobase/fsp
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 17:17:24 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 17:17:24 +0300
commit098c0f2634a35e24e9eb0f06d3fba69d0d097657 (patch)
tree8e6b460d1c8812d29444bf1bd7449e5871105215 /storage/innobase/fsp
parent5bf4dee36943cb4cc95d10863d469192de854800 (diff)
parente5c4f4e590d7782ef938b436f84ae11b68e0af08 (diff)
downloadmariadb-git-098c0f2634a35e24e9eb0f06d3fba69d0d097657.tar.gz
Merge 10.4 into 10.5
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 c6f8410f784..cb9cce26011 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
@@ -447,12 +447,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);
}
@@ -493,7 +508,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);
@@ -508,6 +523,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;