• Luis Soares's avatar
    BUG#42941: --database paramater to mysqlbinlog fails with RBR · 1b1ca7fe
    Luis Soares authored
                
    mysqlbinlog --database parameter was being ignored when processing
    row events. As such no event filtering would take place.
                
    This patch addresses this by deploying a call to shall_skip_database
    when table_map_events are handled (as these contain also the name of
    the database). All other rows events referencing the table id for the
    filtered map event, will also be skipped.
    
    client/mysqlbinlog.cc:
      Added shall_skip_database call to the part of the code that handles 
      Table_map_log_events. It inspects the database name and decides whether
      to filter the event or not. Furthermore, if table map event is filtered
      next events referencing the table id in the table map event, will also
      be filtered.
    mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test:
      Test case that checks if row events are actually filtered out.
    sql/log_event.h:
      Added a map for holding the currently ignored table map events.
      Table map events are inserted when they shall be skipped and removed
      once the last row event in the statement is processed.
    1b1ca7fe
mysqlbinlog.cc 68 KB