mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
Fixed bug #29751 - do not rename the error log at FLUSH LOGS.
Added open log file with FILE_SHARE_DELETE flag on Windows. sql/log.cc: added reopen_fstreams(); modified redirect_std_streams(): call to sequence of freopen() replaced to reopen_fstreams(); modified flush_error_log(): removed file rename for flushed error log file. sql/mysqld.cc: modified main() and init_server_components(): do open log error file over call to reopen_fstreams().
This commit is contained in:
parent
bc05efd8aa
commit
800feb16cb
2 changed files with 82 additions and 54 deletions
|
|
@ -199,6 +199,9 @@ typedef fp_except fp_except_t;
|
|||
# endif
|
||||
#endif
|
||||
|
||||
extern "C" my_bool reopen_fstreams(const char *filename,
|
||||
FILE *outstream, FILE *errstream);
|
||||
|
||||
inline void setup_fpu()
|
||||
{
|
||||
#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H)
|
||||
|
|
@ -3821,13 +3824,15 @@ static int init_server_components()
|
|||
opt_error_log= 1; // Too long file name
|
||||
else
|
||||
{
|
||||
my_bool res;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (freopen(log_error_file, "a+", stdout))
|
||||
res= reopen_fstreams(log_error_file, stdout, stderr);
|
||||
#else
|
||||
res= reopen_fstreams(log_error_file, NULL, stderr);
|
||||
#endif
|
||||
{
|
||||
if (freopen(log_error_file, "a+", stderr))
|
||||
setbuf(stderr, NULL);
|
||||
}
|
||||
|
||||
if (!res)
|
||||
setbuf(stderr, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4475,8 +4480,8 @@ we force server id to 2, but this MySQL server will not act as a slave.");
|
|||
#ifdef __WIN__
|
||||
if (!opt_console)
|
||||
{
|
||||
freopen(log_error_file,"a+",stdout);
|
||||
freopen(log_error_file,"a+",stderr);
|
||||
if (reopen_fstreams(log_error_file, stdout, stderr))
|
||||
unireg_abort(1);
|
||||
setbuf(stderr, NULL);
|
||||
FreeConsole(); // Remove window
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue