• vasil's avatar
    branches/5.1: · 5cb733a3
    vasil authored
    Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
    
    In ha_innobase::info() - do not try to get the free space for a tablespace
    which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the
    .ibd file is missing for some other reason.
    
    ibd_file_missing and tablespace_discarded are manipulated only in
    row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql()
    and the manipulation is protected/surrounded by
    row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we
    do the same in ha_innobase::info() when checking the values of those members
    to avoid race conditions. I have tested the code-path with UNIV_DEBUG and
    UNIV_SYNC_DEBUG.
    
    Looks like it is not possible to avoid mysqld printing warnings in the
    mysql-test case and thus this test innodb_bug39438 must be added to the
    list of exceptional test cases that are allowed to print warnings. For this,
    the following patch must be applied to the mysql source tree:
    
      --- cut ---
      === modified file 'mysql-test/lib/mtr_report.pl'
      --- mysql-test/lib/mtr_report.pl	2008-08-12 10:26:23 +0000
      +++ mysql-test/lib/mtr_report.pl	2008-10-01 11:57:41 +0000
      @@ -412,7 +412,10 @@
       
                       # When trying to set lower_case_table_names = 2
                       # on a case sensitive file system. Bug#37402.
      -                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./
      +                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./ or
      +
      +                # this test is expected to print warnings
      +                ($testname eq 'main.innodb_bug39438')
       		)
                   {
                     next;                       # Skip these lines
      
      --- cut ---
    
    The mysql-test is currently somewhat disabled (see inside
    innodb_bug39438.test), after the above patch has been applied to the mysql
    source tree, the test can be enabled.
    
    rb://20
    
    Reviewed by:	Inaam, Calvin
    Approved by:	Heikki
    5cb733a3
ha_innodb.cc 238 KB