diff options
author | unknown <marko@hundin.mysql.fi> | 2004-08-06 15:55:50 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-08-06 15:55:50 +0300 |
commit | fc4364e3509f9fa625e65f9e124b8133aa103f76 (patch) | |
tree | c1d7d9cd3e693926714ec72a5dba2d8ea59dde2d /innobase/srv/srv0start.c | |
parent | 06cd2efc2e231d0526091e3e9e4dc47985a8081c (diff) | |
download | mariadb-git-fc4364e3509f9fa625e65f9e124b8133aa103f76.tar.gz |
InnoDB: Add option for disabling innodb_status.<pid> files.
InnoDB: Implement tmpfile() differently on Windows (Bug #3998)
innobase/dict/dict0dict.c:
Check the return value of os_file_create_tmpfile(),
as it can now return NULL
innobase/include/os0file.h:
Note that os_file_create_tmpfile() can now return NULL
innobase/include/srv0srv.h:
Add a new server flag (srv_innodb_status) to disable
the creation of innodb_status.<pid> files
innobase/lock/lock0lock.c:
Check the return value of os_file_create_tmpfile(),
as it can now return NULL
innobase/os/os0file.c:
os_file_create_tmpfile(): separate implementation for Win32;
errors will be reported but will not cause assertion failure
innobase/srv/srv0srv.c:
Add a new server flag (srv_innodb_status) to disable
the creation of innodb_status.<pid> files
innobase/srv/srv0start.c:
innobase_start_or_create_for_mysql(): create srv_monitor_file
with tmpfile() or with a visible name "innodb_status.<pid>",
depending on the setting of the flag srv_innodb_status.
sql/ha_innodb.cc:
innobase_init(): initialize srv_innodb_status
update_table_comment(), get_foreign_key_create_info(): replace
tmpfile() with os_file_create_tmpfile()
sql/ha_innodb.h:
Add new Boolean flag, innobase_create_status_file.
sql/mysqld.cc:
Add new Boolean flag, innodb_status_file
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r-- | innobase/srv/srv0start.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 3223854652f..30c9982068e 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1023,16 +1023,24 @@ NetWare. */ mutex_create(&srv_monitor_file_mutex); mutex_set_level(&srv_monitor_file_mutex, SYNC_NO_ORDER_CHECK); - srv_monitor_file_name = mem_alloc( - strlen(fil_path_to_mysql_datadir) + - 20 + sizeof "/innodb_status."); - sprintf(srv_monitor_file_name, "%s/innodb_status.%lu", - fil_path_to_mysql_datadir, os_proc_get_number()); - srv_monitor_file = fopen(srv_monitor_file_name, "w+"); - if (!srv_monitor_file) { - fprintf(stderr, "InnoDB: unable to create %s: %s\n", - srv_monitor_file_name, strerror(errno)); - return(DB_ERROR); + if (srv_innodb_status) { + srv_monitor_file_name = mem_alloc( + strlen(fil_path_to_mysql_datadir) + + 20 + sizeof "/innodb_status."); + sprintf(srv_monitor_file_name, "%s/innodb_status.%lu", + fil_path_to_mysql_datadir, os_proc_get_number()); + srv_monitor_file = fopen(srv_monitor_file_name, "w+"); + if (!srv_monitor_file) { + fprintf(stderr, "InnoDB: unable to create %s: %s\n", + srv_monitor_file_name, strerror(errno)); + return(DB_ERROR); + } + } else { + srv_monitor_file_name = NULL; + srv_monitor_file = os_file_create_tmpfile(); + if (!srv_monitor_file) { + return(DB_ERROR); + } } /* Restrict the maximum number of file i/o threads */ @@ -1527,8 +1535,10 @@ innobase_shutdown_for_mysql(void) if (srv_monitor_file) { fclose(srv_monitor_file); srv_monitor_file = 0; - unlink(srv_monitor_file_name); - mem_free(srv_monitor_file_name); + if (srv_monitor_file_name) { + unlink(srv_monitor_file_name); + mem_free(srv_monitor_file_name); + } } mutex_free(&srv_monitor_file_mutex); |