--- storage/innobase/handler/ha_innodb.cc.orig 2008-07-23 09:38:52.000000000 +0300 +++ storage/innobase/handler/ha_innodb.cc 2008-07-23 09:38:48.000000000 +0300 @@ -5835,9 +5835,19 @@ ha_innobase::info( stats.index_file_length = ((ulonglong) ib_table->stat_sum_of_other_index_sizes) * UNIV_PAGE_SIZE; - stats.delete_length = - fsp_get_available_space_in_free_extents( - ib_table->space) * 1024; + + /* Since fsp_get_available_space_in_free_extents() is + acquiring locks, we only call it if we are not asked + to avoid locking. See Bug#38185. + We do not update delete_length if no locking is requested + so the "old" value can remain. delete_length is initialized + to 0 in the ha_statistics' constructor. */ + if (!(flag & HA_STATUS_NO_LOCK)) { + stats.delete_length = + fsp_get_available_space_in_free_extents( + ib_table->space) * 1024; + } + stats.check_time = 0; if (stats.records == 0) { --- sql/sql_show.cc.orig 2008-07-23 09:32:14.000000000 +0300 +++ sql/sql_show.cc 2008-07-23 09:32:19.000000000 +0300 @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD if(file) { - file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO | - HA_STATUS_NO_LOCK); + file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO); enum row_type row_type = file->get_row_type(); switch (row_type) { case ROW_TYPE_NOT_USED: