• Marko Mäkelä's avatar
    MDEV-18518 follow-up fixes · cc2ddde4
    Marko Mäkelä authored
    Make DDL operations that involve FULLTEXT INDEX atomic.
    In particular, we must drop the internal FTS_ tables in the same
    DDL transaction with ALTER TABLE.
    
    Remove all references to fts_drop_orphaned_tables().
    
    row_merge_drop_temp_indexes(): Drop also the internal FTS_ tables
    that are associated with index stubs that were created in
    prepare_inplace_alter_table_dict() for
    CREATE FULLTEXT INDEX before the server was killed.
    
    fts_clear_all(): Remove the fts_drop_tables() call. It has to be
    executed before the transaction is committed!
    
    dict_load_indexes(): Do not load any metadata for index stubs
    that had been created by prepare_inplace_alter_table_dict()
    
    fts_create_one_common_table(), fts_create_common_tables(),
    fts_create_one_index_table(), fts_create_index_tables():
    Remove redundant error handling. The tables will be dropped
    just fine by dict_drop_index_tree().
    
    commit_try_norebuild(): Also drop the FTS_ tables when dropping
    FULLTEXT INDEX.
    
    The changes to the test case innodb_fts.crash_recovery has been
    extensively tested. The non-debug server will be killed while
    the 3 ALTER TABLE are in any phase of execution. With the debug
    server, DEBUG_SYNC should make the test deterministic.
    cc2ddde4
crash_recovery.test 10.6 KB