• vasil's avatar
    branches/zip: · 22ecced6
    vasil authored
    Merge 2537:2605 from branches/5.1:
    
      ------------------------------------------------------------------------
      r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines
      Changed paths:
         M /branches/5.1/handler/ha_innodb.cc
      
      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
      
      ------------------------------------------------------------------------
      r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines
      Changed paths:
         M /branches/5.1/handler/ha_innodb.cc
         M /branches/5.1/include/ha_prototypes.h
         M /branches/5.1/row/row0sel.c
      
      branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT
      instead of parsing the query string.  This fixes MySQL Bug #37885 without
      us having to implement lexical analysis of SQL comments in yet another place.
      
      thd_is_select(): A new predicate.
      
      row_search_for_mysql(): Use thd_is_select().
      
      Approved by Heikki.
      
      ------------------------------------------------------------------------
    22ecced6
ha_innodb.cc 274 KB