• Aleksey Midenkov's avatar
    MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name · 3537e7cf
    Aleksey Midenkov authored
    Use temporary constraint names for temporary tables. The constraints
    are not added to cache (skipped in dict_table_rename_in_cache()).
    
    The scheme for temporary constraint names is as follows:
    
        for old table: db_name/\xFFconstraint_name
        for new table: db_name/\xFF\xFFconstraint_name
    
    normalize_table_name_c_low(): wrong comparison "less than FN_REFLEN -
    1". Somewhere array of FN_REFLEN includes the trailing 0, somewhere
    array of FN_REFLEN + 1 includes trailing 0, but nowhere array of
    FN_REFLEN - 1 must include trailing 0.
    
    Change from original MDEV-28933 fix:
    
    As temporary FK is now required for any ALTER operation (especially
    partitioning operations) row_rename_table_for_mysql() does FK rename
    on both RENAME_FK and RENAME_ALTER_COPY (see do_rename_fk).
    3537e7cf
innodb-index.test 40.2 KB