diff options
author | marko@hundin.mysql.fi <> | 2005-04-19 14:35:47 +0300 |
---|---|---|
committer | marko@hundin.mysql.fi <> | 2005-04-19 14:35:47 +0300 |
commit | f9d145ef04825875446dd98088100415b7e56849 (patch) | |
tree | 39b48cfae69fdb476beaf2fd2220ff88a9219dde /innobase/srv | |
parent | 2df2c4b8957a583e213e69849e6cab8a1f3cce15 (diff) | |
download | mariadb-git-f9d145ef04825875446dd98088100415b7e56849.tar.gz |
InnoDB: Truncate SHOW INNODB STATUS output at the start of the list
of active transactions, if necessary and possible. (Bug #5436)
Diffstat (limited to 'innobase/srv')
-rw-r--r-- | innobase/srv/srv0srv.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index a60e9e5a5f7..e56389a8541 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1470,7 +1470,11 @@ Outputs to a file the output of the InnoDB Monitor. */ void srv_printf_innodb_monitor( /*======================*/ - FILE* file) /* in: output stream */ + FILE* file, /* in: output stream */ + ulint* trx_start, /* out: file position of the start of + the list of active transactions */ + ulint* trx_end) /* out: file position of the end of + the list of active transactions */ { double time_elapsed; time_t current_time; @@ -1519,7 +1523,24 @@ srv_printf_innodb_monitor( mutex_exit(&dict_foreign_err_mutex); - lock_print_info(file); + lock_print_info_summary(file); + if (trx_start) { + long t = ftell(file); + if (t < 0) { + *trx_start = ULINT_UNDEFINED; + } else { + *trx_start = (ulint) t; + } + } + lock_print_info_all_transactions(file); + if (trx_end) { + long t = ftell(file); + if (t < 0) { + *trx_end = ULINT_UNDEFINED; + } else { + *trx_end = (ulint) t; + } + } fputs("--------\n" "FILE I/O\n" "--------\n", file); @@ -1672,13 +1693,13 @@ loop: last_monitor_time = time(NULL); if (srv_print_innodb_monitor) { - srv_printf_innodb_monitor(stderr); + srv_printf_innodb_monitor(stderr, NULL, NULL); } if (srv_innodb_status) { mutex_enter(&srv_monitor_file_mutex); rewind(srv_monitor_file); - srv_printf_innodb_monitor(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file, NULL, NULL); os_file_set_eof(srv_monitor_file); mutex_exit(&srv_monitor_file_mutex); } |