summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmysql/libmysql.c7
-rw-r--r--sql/mysql_priv.h1
-rw-r--r--sql/mysqld.cc3
3 files changed, 10 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 3931d7947aa..11ee7284cbf 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -189,6 +189,13 @@ void STDCALL mysql_server_end()
finish_client_errs();
free_charsets();
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=
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 2190c4a1b24..c56496c394d 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1156,6 +1156,7 @@ extern uint opt_large_page_size;
extern MYSQL_LOG mysql_log,mysql_slow_log,mysql_bin_log;
extern FILE *bootstrap_file;
extern int bootstrap_error;
+extern FILE *stderror_file;
extern pthread_key(MEM_ROOT**,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 5d2eb4b9e17..f8bfcb75be2 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -447,6 +447,7 @@ Le_creator le_creator;
FILE *bootstrap_file;
int bootstrap_error;
+FILE *stderror_file=0;
I_List<i_string_pair> replicate_rewrite_db;
I_List<i_string> replicate_do_db, replicate_ignore_db;
@@ -2878,7 +2879,7 @@ server.");
#ifndef EMBEDDED_LIBRARY
if (freopen(log_error_file, "a+", stdout))
#endif
- freopen(log_error_file, "a+", stderr);
+ stderror_file= freopen(log_error_file, "a+", stderr);
}
}