• Leonard Zhou's avatar
    Bug#40013 mixed replication: row based format could lead to stale tmp tables on the · ab369861
    Leonard Zhou authored
    slave.
    
    In mixed mode, if we create a temporary table and do some update which switch to ROW format,
    the format will keep in ROW format until the session ends or the table is dropped explicitly. 
    When the session ends, the temp table is dropped automaticly at cleanup time.
    but it checks only current binlog format and so skip insertion of DROP TABLE instructions into binlog.
    So the temp table can't be dropped correctly at slave.
    
    Our solution is that when closing temp tables at cleanup time we check both binlog format and binlog mode,
    and we could write DROP TABLE instructions into binlog if current binlog format is ROW but in MIX mode.
    
    mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result:
      Test result file.
    mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test:
      Test file.
    sql/sql_base.cc:
      Didn't do binloging when both current format and default format are ROW.
    ab369861
rpl_temp_table_mix_row.test 1.14 KB