Skip to content
  • Sunny Bains's avatar
    f912c12a
    Bug#14735917 - ONLINE ALTER TABLE DOESN'T HANDLE DISCARDED TABLESPACES PROPERLY · f912c12a
    Sunny Bains authored
          
    The failure on Windows is a side effect of a bigger problem that exists on
    all platforms. The reason it fails on Windows is because on Windows
    rename("o","n") will fail if "n" exists. The deeper problem is that the
    rename should not even be taking place. The second error is that if we do
    an ALTER algorithm=INPLACE it will reset the discarded flag and create a
    new .ibd file. In essence, allowing a NULL IMPORT. Some of the tests were
    actually written that made use of this behaviour. This is wrong.
    					        
    The fix is to drop any temp tables and prevent rename on disk. Make the
    new table inherit the discarded flag. Add a debug check in the rename
    function that mimics Windows behaviour. This helped in reproducing the
    underlying problem on Linux too.
    
    rb://1389 Approved by Marko Makela
    f912c12a
    Bug#14735917 - ONLINE ALTER TABLE DOESN'T HANDLE DISCARDED TABLESPACES PROPERLY
    Sunny Bains authored
          
    The failure on Windows is a side effect of a bigger problem that exists on
    all platforms. The reason it fails on Windows is because on Windows
    rename("o","n") will fail if "n" exists. The deeper problem is that the
    rename should not even be taking place. The second error is that if we do
    an ALTER algorithm=INPLACE it will reset the discarded flag and create a
    new .ibd file. In essence, allowing a NULL IMPORT. Some of the tests were
    actually written that made use of this behaviour. This is wrong.
    					        
    The fix is to drop any temp tables and prevent rename on disk. Make the
    new table inherit the discarded flag. Add a debug check in the rename
    function that mimics Windows behaviour. This helped in reproducing the
    underlying problem on Linux too.
    
    rb://1389 Approved by Marko Makela
Loading