• Jon Olav Hauglid's avatar
    Bug #56595 RENAME TABLE causes assert on OS X · f14d947c
    Jon Olav Hauglid authored
    The problem was that RENAME TABLE caused an assert if the system variable
    lower_case_table_names was 2 (default on Mac OS X) and the old table name
    was given in upper case. This caused lowercase_table2.test to fail.
    
    The assert checks that an exclusive metadata lock is held by the connection
    trying to do RENAME TABLE - specificially during updates of table triggers.
    The assert was triggered since the check is case sensitive and the lock
    was held on the normalized (lower case) version of the table name.
    
    This patch fixes the problem by making sure a normalized version of the
    table name is used for the metadata lock check, while using a non-normalized
    version of the table name for the rename of trigger files. The same is done
    for ALTER TABLE ... RENAME.
    
    Regression testing for the bug itself is already covered by
    lowercase_table2.test. Additional coverage added to lowercase_fs_off.test.
    f14d947c
sql_rename.cc 10.8 KB