diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-15 19:56:24 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-10-15 19:56:24 +0300 |
commit | b872877aba5118abfeb520bf91b2edf5a5e13cc7 (patch) | |
tree | 134a291022ba6abcce76e125912b1b55cf965963 /dbug | |
parent | 3e7e78d7fce2fb97eab3df29c3e3f26c9b72a1be (diff) | |
download | mariadb-git-b872877aba5118abfeb520bf91b2edf5a5e13cc7.tar.gz |
Bug #27099: system_mysql fail in pushbuild windows
On Windows the debug log was doing freopen () instead of
fflush() and that was slowing the logging down that much
that some tests timed out.
Fixed by replacing the freopen() with an syncing-to-disk
flag to fopen() and fflush().
Also increased the timeout of the tests running with --debug
on windows : seems to slow down as much as valgrind on linux.
dbug/dbug.c:
Bug #27099: remove the freopen() for the
windows log : too slow. Replace it with the "c" option
for fopen().
mysql-test/mysql-test-run.pl:
Bug #27099: on windows debug log seems to slow the tests
down about as much as valgrind does on linux.
Diffstat (limited to 'dbug')
-rw-r--r-- | dbug/dbug.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 9d638c299d3..7f4292d18b1 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -1826,7 +1826,13 @@ static void DBUGOpenFile(CODE_STATE *cs, else { newfile= !EXISTS(name); - if (!(fp= fopen(name, append ? "a+" : "w"))) + if (!(fp= fopen(name, +#if defined(MSDOS) || defined(__WIN__) + append ? "a+c" : "wc" +#else + append ? "a+" : "w" +#endif + ))) { (void) fprintf(stderr, ERR_OPEN, cs->process, name); perror(""); @@ -2231,23 +2237,9 @@ static void dbug_flush(CODE_STATE *cs) if (cs->stack->flags & FLUSH_ON_WRITE) #endif { -#if defined(MSDOS) || defined(__WIN__) - if (cs->stack->out_file != stdout && cs->stack->out_file != stderr) - { - if (!(freopen(cs->stack->name,"a",cs->stack->out_file))) - { - (void) fprintf(stderr, ERR_OPEN, cs->process, cs->stack->name); - fflush(stderr); - cs->stack->out_file= stderr; - } - } - else -#endif - { - (void) fflush(cs->stack->out_file); - if (cs->stack->delay) - (void) Delay(cs->stack->delay); - } + (void) fflush(cs->stack->out_file); + if (cs->stack->delay) + (void) Delay(cs->stack->delay); } if (!cs->locked) pthread_mutex_unlock(&THR_LOCK_dbug); |