• Sergey Vojtovich's avatar
    BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't · 1d2aeb3d
    Sergey Vojtovich authored
                work in 5.1.40)
    
    MERGE engine fails to open child table from a different
    database if child table/database name contains characters
    that are subject for table name to filename encoding
    (WL1324).
    
    Another problem is that MERGE engine didn't properly open
    child table from the same database if child table name
    contains characters like '/', '#'.
    
    The problem was that table name to file name encoding was
    applied inconsistently:
    * On CREATE: encode table name + database name if child
      table is in different database; do not encode table
      name if child table is in the same database;
    * No decoding on open.
    
    With this fix child table/database names are always
    encoded on CREATE and decoded on open. Compatibility
    with older tables preserved.
    
    Along with this patch comes fix for SHOW CREATE TABLE,
    which used to show child table/database path instead
    of child table/database names.
    
    mysql-test/r/merge.result:
      A test case for BUG#48265.
    mysql-test/std_data/bug48265.frm:
      MERGE table from 5.0 to test fix for BUG#48265 compatibility.
    mysql-test/t/merge.test:
      A test case for BUG#48265.
    storage/myisammrg/ha_myisammrg.cc:
      On CREATE always write child table/database name encoded
      by table name to filename encoding to dot-MRG file.
      
      On open decode child table/database name.
      Compatibilty with previous versions preserved.
      
      Fixed ::append_create_info() to return child
      table/database name instead of path.
    storage/myisammrg/myrg_open.c:
      Move if (has_path) branch from myrg_parent_open() to
      myisammrg_parent_open_callback. The callback function
      needs to know if child table was written along with
      database name to dot-MRG file. Needed for compatibility
      reasons.
    1d2aeb3d
merge.test 51.6 KB