• unknown's avatar
    Bug #49132 Replication failure on temporary table + DDL · 3cae7d11
    unknown authored
    In RBR, DDL statement will change binlog format to non row-based
    format before it is binlogged, but the binlog format was not be
    restored, and then manipulating a temporary table can not reset binlog
    format to row-based format rightly. So that the manipulated statement
    is binlogged with statement-based format.
    
    To fix the problem, restore the state of binlog format after the DDL
    statement is binlogged.
    
    mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test:
      Added the test file to verify if executing DDL statement before
      trying to manipulate a temporary table causes row-based replication
      to break with error 'table does not exist'.
    mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
      Correct the test result, all the above binlog event
      should be row-based after the bug49132 is fixed IN RBR.
    mysql-test/suite/ndb/r/ndb_tmp_table_and_DDL.result:
      Test result for bug#49132 base on ndb engine.
    mysql-test/suite/ndb/t/ndb_tmp_table_and_DDL.test:
      Added the test file to verify if executing DDL statement before
      trying to manipulate a temporary table causes row-based replication
      to break with error 'table does not exist' base on ndb engine.
    mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result:
      Test result for bug#49132 base on myisam engine.
    mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test:
      Added the test file to verify if executing DDL statement before
      trying to manipulate a temporary table causes row-based replication
      to break with error 'table does not exist' base on myisam engine.
    sql/event_db_repository.cc:
      Added code to restore the state of binlog format after the DDL
      statement is binlogged.
    sql/events.cc:
      Added code to restore the state of binlog format after the DDL
      statement is binlogged.
    sql/sp.cc:
      Added code to restore the state of binlog format after the DDL
      statement is binlogged.
    sql/sql_acl.cc:
      Added code to restore the state of binlog format after the DDL
      statement is binlogged.
    sql/sql_udf.cc:
      Added code to restore the state of binlog format after the DDL
      statement is binlogged.
    3cae7d11
events.cc 36.1 KB