• Andrei Elkin's avatar
    Bug#42977 RBR logs for rows with more than 250 column results in corrupt binlog · 67f9a6d1
    Andrei Elkin authored
                
    The issue happened to be two-fold.
    The table map event was recorded into binlog having
    an incorrect size when number of columns exceeded 251. 
    The Row-based event had incorrect recording and restoring m_width member within
    the same as above conditions.
    
    Fixed with correcting m_data_size and m_width.
    
    
    mysql-test/suite/rpl/r/rpl_row_wide_table.result:
      the new test results.
    mysql-test/suite/rpl/t/rpl_row_wide_table.test:
      regression test for bug#42977.
    sql/log_event.cc:
      0. all buffers that used in net_store_length() are augmented with 1 for safety
      to be able to contain the magic and the content of ulonglong as well;
      1. Rows_log_event::get_data_size() yieled incorrect size |m_width/8| whereas 
         it should be m_width;
      2. Table_map_log_event::Table_map_log_event yieled incorrect value for
         `m_data_size' probably presuming 1-byte integer max for the column number;
    sql/rpl_utility.h:
      DBUG_PRINT_BITSET() macro is left 256-cols limited but has made safe and commented.
    67f9a6d1
log_event.cc 295 KB