• vasil's avatar
    branches/5.1: · dd439ba6
    vasil authored
    Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK
    
    The fix is to call fsp_get_available_space_in_free_extents() from
    ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag
    *AND*
    change get_schema_tables_record() in MySQL's sql/sql_show.cc to call
    ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM
    information_schema.tables;
    
    Without the change to sql/sql_show.cc this patch would lead to Bug#32440
    resurfacing. I.e. delete_length would never be updated in ::info() and
    will remain 0 forever, resulting in the free space not being shown
    anywhere.
    
    This is the change to sql/sql_show.cc for reference, it needs to be
    committed to the MySQL repo before or at the same time with this change
    to ha_innodb.cc:
    
     --- patch begins here ---
     --- 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:
     --- patch ends here ---
    
    Approved by:	Heikki
    dd439ba6
ha_innodb.cc 236 KB