diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index d2219ed019f..357fb01df63 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -233,8 +233,19 @@ trx_free( /*=====*/ trx_t* trx) /* in, own: trx object */ { + char err_buf[1000]; + ut_ad(mutex_own(&kernel_mutex)); + if (trx->declared_to_be_inside_innodb) { + ut_print_timestamp(stderr); + trx_print(err_buf, trx); + + fprintf(stderr, +" InnoDB: Error: Freeing a trx which is declared to be processing\n" +"InnoDB: inside InnoDB.\n%s\n", err_buf); + } + ut_a(trx->magic_n == TRX_MAGIC_N); trx->magic_n = 11112222; @@ -1518,6 +1529,11 @@ trx_print( buf += sprintf(buf, " purge trx"); } + if (trx->declared_to_be_inside_innodb) { + buf += sprintf(buf, ", thread declared inside InnoDB %lu", + trx->n_tickets_to_enter_innodb); + } + buf += sprintf(buf, "\n"); start_of_line = buf; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index baeb16997b6..e7fbe1c521a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -3938,18 +3938,21 @@ innodb_show_status( DBUG_RETURN(-1); } - /* We let the InnoDB Monitor to output at most 100 kB of text, add + /* We let the InnoDB Monitor to output at most 200 kB of text, add a safety margin of 10 kB for buffer overruns */ - buf = (char*)ut_malloc(110 * 1024); + buf = (char*)ut_malloc(210 * 1024); - srv_sprintf_innodb_monitor(buf, 100 * 1024); + srv_sprintf_innodb_monitor(buf, 200 * 1024); List field_list; field_list.push_back(new Item_empty_string("Status", strlen(buf))); if(send_fields(thd, field_list, 1)) { + + ut_free(buf); + DBUG_RETURN(-1); }