1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Bug#42790 Test 'main.innodb' fails from "InnoDB: Error: in ALTER TABLE"

The problem here seem to be that when mysql
is redirecting stderr to a file, stderr becomes 
buffered, whereas it is unbuffered by definition.

The solution is to unbuffer it by setting buffer
to null.
This commit is contained in:
Narayanan V
2009-03-05 15:18:03 +05:30
parent 96d5bac856
commit 1a5751ba4e
2 changed files with 11 additions and 0 deletions

View File

@@ -4650,10 +4650,14 @@ bool flush_error_log()
uchar buf[IO_SIZE];
freopen(err_temp,"a+",stderr);
setbuf(stderr, NULL);
(void) my_delete(err_renamed, MYF(0));
my_rename(log_error_file,err_renamed,MYF(0));
if (freopen(log_error_file,"a+",stdout))
{
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
}
if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0)
{
@@ -4669,7 +4673,10 @@ bool flush_error_log()
#else
my_rename(log_error_file,err_renamed,MYF(0));
if (freopen(log_error_file,"a+",stdout))
{
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
}
else
result= 1;
#endif

View File

@@ -3703,7 +3703,10 @@ static int init_server_components()
#ifndef EMBEDDED_LIBRARY
if (freopen(log_error_file, "a+", stdout))
#endif
{
freopen(log_error_file, "a+", stderr);
setbuf(stderr, NULL);
}
}
}
@@ -4331,6 +4334,7 @@ we force server id to 2, but this MySQL server will not act as a slave.");
{
freopen(log_error_file,"a+",stdout);
freopen(log_error_file,"a+",stderr);
setbuf(stderr, NULL);
FreeConsole(); // Remove window
}
#endif