Commit 36a2a092 authored by unknown's avatar unknown

Fix for bug #12177 (errorlog file isn't closed)

4.1 version of the patch


libmysql/libmysql.c:
  here we close errorlog file
sql/mysql_priv.h:
  stderror_file declared
sql/mysqld.cc:
  stderror_file saved
parent 5c2578b9
...@@ -188,6 +188,13 @@ void STDCALL mysql_server_end() ...@@ -188,6 +188,13 @@ void STDCALL mysql_server_end()
mysql_thread_end(); mysql_thread_end();
free_charsets(); free_charsets();
mysql_client_init= org_my_init_done= 0; mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER
if (stderror_file)
{
fclose(stderror_file);
stderror_file= 0;
}
#endif
} }
static MYSQL_PARAMETERS mysql_internal_parameters= static MYSQL_PARAMETERS mysql_internal_parameters=
......
...@@ -941,6 +941,7 @@ extern char *default_tz_name; ...@@ -941,6 +941,7 @@ extern char *default_tz_name;
extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log;
extern FILE *bootstrap_file; extern FILE *bootstrap_file;
extern FILE *stderror_file;
extern pthread_key(MEM_ROOT**,THR_MALLOC); extern pthread_key(MEM_ROOT**,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status, LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
......
...@@ -382,6 +382,7 @@ Le_creator le_creator; ...@@ -382,6 +382,7 @@ Le_creator le_creator;
FILE *bootstrap_file; FILE *bootstrap_file;
FILE *stderror_file=0;
I_List<i_string_pair> replicate_rewrite_db; I_List<i_string_pair> replicate_rewrite_db;
I_List<i_string> replicate_do_db, replicate_ignore_db; I_List<i_string> replicate_do_db, replicate_ignore_db;
...@@ -2767,7 +2768,7 @@ server."); ...@@ -2767,7 +2768,7 @@ server.");
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (freopen(log_error_file, "a+", stdout)) if (freopen(log_error_file, "a+", stdout))
#endif #endif
freopen(log_error_file, "a+", stderr); stderror_file= freopen(log_error_file, "a+", stderr);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment