branches/5.1:
branches/5.1:

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


flynn1973/mariadb-aix,davidl-zend/zenddbi,davidl-zend/zenddbi,ollie314/server,ollie314/server,davidl-zend/zenddbi,ollie314/server,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,ollie314/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,davidl-zend/zenddbi,slanterns/server,natsys/mariadb_10.2,flynn1973/mariadb-aix,flynn1973/mariadb-aix,natsys/mariadb_10.2,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,natsys/mariadb_10.2,natsys/mariadb_10.2,flynn1973/mariadb-aix,davidl-zend/zenddbi,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,davidl-zend/zenddbi,flynn1973/mariadb-aix,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,ollie314/server,natsys/mariadb_10.2,ollie314/server,davidl-zend/zenddbi,flynn1973/mariadb-aix,ollie314/server