summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/os0sync.h4
-rw-r--r--innobase/os/os0file.c5
-rw-r--r--innobase/srv/srv0start.c16
3 files changed, 22 insertions, 3 deletions
diff --git a/innobase/include/os0sync.h b/innobase/include/os0sync.h
index a45f738f22b..3201a12b0a7 100644
--- a/innobase/include/os0sync.h
+++ b/innobase/include/os0sync.h
@@ -190,9 +190,9 @@ os_fast_mutex_free(
/*===============*/
os_fast_mutex_t* fast_mutex); /* in: mutex to free */
#endif
-
+
#ifndef UNIV_NONINL
#include "os0sync.ic"
#endif
-#endif
+#endif
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 7851b83732d..f155e15ac49 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -316,8 +316,11 @@ try_again:
UT_NOT_USED(purpose);
if (create_mode == OS_FILE_CREATE) {
-
+#ifndef S_IRWXU
+ file = open(name, create_flag);
+#else
file = open(name, create_flag, S_IRWXU | S_IRWXG | S_IRWXO);
+#endif
} else {
file = open(name, create_flag);
}
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index f627e5d6aa5..a3e94b63e37 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -56,6 +56,9 @@ Created 2/16/1996 Heikki Tuuri
#include "srv0start.h"
#include "que0que.h"
+ibool srv_is_being_started = FALSE;
+ibool srv_was_started = FALSE;
+
ibool measure_cont = FALSE;
os_file_t files[1000];
@@ -443,6 +446,8 @@ innobase_start_or_create_for_mysql(void)
log_do_write = TRUE;
/* yydebug = TRUE; */
+ srv_is_being_started = TRUE;
+
os_aio_use_native_aio = srv_use_native_aio;
err = srv_boot();
@@ -676,6 +681,9 @@ innobase_start_or_create_for_mysql(void)
thread_ids + 2 + SRV_MAX_N_IO_THREADS);
fprintf(stderr, "Innobase: Started\n");
+ srv_was_started = TRUE;
+ srv_is_being_started = FALSE;
+
sync_order_checks_on = TRUE;
/* buf_debug_prints = TRUE; */
@@ -691,6 +699,14 @@ innobase_shutdown_for_mysql(void)
/*=============================*/
/* out: DB_SUCCESS or error code */
{
+ if (!srv_was_started) {
+ if (srv_is_being_started) {
+ fprintf(stderr,
+ "Innobase: Warning: shutting down not properly started database\n");
+ }
+ return(DB_SUCCESS);
+ }
+
/* Flush buffer pool to disk, write the current lsn to
the tablespace header(s), and copy all log data to archive */