summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@sun.com>2009-10-12 15:35:30 +0200
committerMagne Mahre <magne.mahre@sun.com>2009-10-12 15:35:30 +0200
commit10390cec03109dd9ffd0d6785d2bc843166fcf38 (patch)
tree5bfb8dc2f12d9720b7cff556cac673c461708b28 /sql/mysqld.cc
parent0e852eba7cef8a61cf40d1ffefcf236c91c6031e (diff)
downloadmariadb-git-10390cec03109dd9ffd0d6785d2bc843166fcf38.tar.gz
Bug #33693 general log name and location depend on PID file,
not on predefined values The default name of the PID file was constructed, as documented, based on the hostname. This name was subsequently used as the base for the general log file name. If the name of the PID file was overridden in the configuration, and no explicit name was set for the general log file, the path location for the PID file was used also for the general log file. A new variable, 'default_logfile_name', has been introduced. This name is constructed based on the hostname, and is then used to construct both the PID file and the general log file. The general log file will now, unless explicitly set, be located in the server data directory (as documentated in the server docs)
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 78faaccf881..580842c944e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -572,6 +572,7 @@ const char *log_output_str= "FILE";
time_t server_start_time, flush_status_time;
char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
+char default_logfile_name[FN_REFLEN];
char *default_tz_name;
char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
char mysql_real_data_home[FN_REFLEN],
@@ -3168,10 +3169,13 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmake(glob_hostname, STRING_WITH_LEN("localhost"));
sql_print_warning("gethostname failed, using '%s' as hostname",
glob_hostname);
- strmake(pidfile_name, STRING_WITH_LEN("mysql"));
+ strmake(default_logfile_name, STRING_WITH_LEN("mysql"));
}
else
- strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5);
+ strmake(default_logfile_name, glob_hostname,
+ sizeof(default_logfile_name)-5);
+
+ strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5);
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
/*