Commit fc7ae6a2 authored by marko@hundin.mysql.fi's avatar marko@hundin.mysql.fi

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

(Bug #3596)
parent 09fc3594
......@@ -1609,6 +1609,11 @@ srv_lock_timeout_and_monitor_thread(
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment