mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
InnoDB: Truncate "<datadir>/innodb.status.<pid>" to its actual size
(Bug #3596)
This commit is contained in:
parent
09fc359480
commit
fc7ae6a222
2 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue