InnoDB: Truncate "<datadir>/innodb.status.<pid>" to its actual size

(Bug #3596)
This commit is contained in:
marko@hundin.mysql.fi 2004-05-05 11:50:58 +03:00
parent 09fc359480
commit fc7ae6a222
2 changed files with 10 additions and 0 deletions

View file

@ -1609,6 +1609,11 @@ loop:
mutex_enter(&srv_monitor_file_mutex);
rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file);
#ifdef __WIN__
chsize(fileno(srv_monitor_file), ftell(srv_monitor_file));
#else /* __WIN__ */
ftruncate(fileno(srv_monitor_file), ftell(srv_monitor_file));
#endif /* __WIN__ */
mutex_exit(&srv_monitor_file_mutex);
if (srv_print_innodb_tablespace_monitor

View file

@ -4648,6 +4648,11 @@ innodb_show_status(
rewind(srv_monitor_file);
srv_printf_innodb_monitor(srv_monitor_file);
flen = ftell(srv_monitor_file);
#ifdef __WIN__
chsize(fileno(srv_monitor_file), flen);
#else /* __WIN__ */
ftruncate(fileno(srv_monitor_file), flen);
#endif /* __WIN__ */
if(flen > 64000 - 1) {
flen = 64000 - 1;
}