• Sergey Vojtovich's avatar
    BUG#51307 - widespread corruption with partitions and · a82cc509
    Sergey Vojtovich authored
                insert...select
    
    Queries following bulk insert into an empty MyISAM table
    may break it. This was pure MyISAM problem.
    
    When bulk insert into an empty table is complete, MyISAM
    may want to enable indexes via repair by sort. If repair
    by sort fails (e.g. insufficient buffer), MyISAM failover
    to repair with key cache, requesting repair of data file.
    
    Repair of data file performs data file substitution. This
    means that current table instance will point to new data
    file. Other cached table instances are still pointing to
    an old, deleted data file.
    
    This is fixed by not requesting repair of data file
    during enable indexes.
    
    Explicit REPAIR is not affected, since it flushes all
    table instances.
    
    mysql-test/r/myisam.result:
      A test case for BUG#51307.
    mysql-test/t/myisam.test:
      A test case for BUG#51307.
    storage/myisam/ha_myisam.cc:
      When enabling indexes do not attempt to repair data file.
    a82cc509
ha_myisam.cc 67.8 KB