• Jon Olav Hauglid's avatar
    Bug #11765416 (former 58381) · f94e7288
    Jon Olav Hauglid authored
    FAILED DROP DATABASE CAN BREAK STATEMENT BASED REPLICATION
    
    The first phase of DROP DATABASE is to delete the tables in the database.
    If deletion of one or more of the tables fail (e.g. due to a FOREIGN KEY
    constraint), DROP DATABASE will be aborted. However, some tables could
    still have been deleted. The problem was that nothing would be written
    to the binary log in this case, so any slaves would not delete these tables.
    Therefore the master and the slaves would get out of sync.
    
    This patch fixes the problem by making sure that DROP TABLE is written
    to the binary log for the tables that were in fact deleted by the failed
    DROP DATABASE statement.
    
    Test case added to binlog.binlog_database.test.
    f94e7288
sql_db.cc 54.5 KB