From 14c7c747a5efc2a28ff67d218cb077e84390011b Mon Sep 17 00:00:00 2001 From: Mark Leith Date: Thu, 23 Sep 2010 09:12:09 +0100 Subject: [PATCH] Bug#56922 SHOW ENGINE INNODB STATUS truncation limit is too strict and not instrumented rb://459 approved by Jimmuy / Inaam --- storage/innobase/handler/ha_innodb.cc | 5 ++++- storage/innobase/include/srv0srv.h | 5 ++++- storage/innobase/srv/srv0srv.c | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e3b20f79464..6bcca31cfcc 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -674,6 +674,8 @@ static SHOW_VAR innodb_status_variables[]= { (char*) &export_vars.innodb_rows_read, SHOW_LONG}, {"rows_updated", (char*) &export_vars.innodb_rows_updated, SHOW_LONG}, + {"truncated_status_writes", + (char*) &export_vars.innodb_truncated_status_writes, SHOW_LONG}, {NullS, NullS, SHOW_LONG} }; @@ -8969,7 +8971,7 @@ innodb_show_status( { trx_t* trx; static const char truncated_msg[] = "... truncated...\n"; - const long MAX_STATUS_SIZE = 64000; + const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; @@ -8999,6 +9001,7 @@ innodb_show_status( if (flen > MAX_STATUS_SIZE) { usable_len = MAX_STATUS_SIZE; + srv_truncated_status_writes++; } else { usable_len = flen; } diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index d78c8113aee..5d2fb808dc9 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -225,6 +225,8 @@ extern ulong srv_thread_sleep_delay; extern ulong srv_spin_wait_delay; extern ibool srv_priority_boost; +extern ulint srv_truncated_status_writes; + extern ulint srv_mem_pool_size; extern ulint srv_lock_table_size; @@ -710,11 +712,12 @@ struct export_var_struct{ ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */ ulint innodb_rows_updated; /*!< srv_n_rows_updated */ ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */ + ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */ }; /** Thread slot in the thread table */ typedef struct srv_slot_struct srv_slot_t; - + /** Thread table is an array of slots */ typedef srv_slot_t srv_table_t; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 714b0355506..72b095c7ad4 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -424,6 +424,7 @@ UNIV_INTERN ulint srv_n_lock_wait_current_count = 0; UNIV_INTERN ib_int64_t srv_n_lock_wait_time = 0; UNIV_INTERN ulint srv_n_lock_max_wait_time = 0; +UNIV_INTERN ulint srv_truncated_status_writes = 0; /* Set the following to 0 if you want InnoDB to write messages on @@ -2032,6 +2033,7 @@ srv_export_innodb_status(void) export_vars.innodb_rows_inserted = srv_n_rows_inserted; export_vars.innodb_rows_updated = srv_n_rows_updated; export_vars.innodb_rows_deleted = srv_n_rows_deleted; + export_vars.innodb_truncated_status_writes = srv_truncated_status_writes; mutex_exit(&srv_innodb_monitor_mutex); }