diff options
author | Andrei Elkin <aelkin@mysql.com> | 2009-03-25 12:53:56 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2009-03-25 12:53:56 +0200 |
commit | 67f9a6d1782ff9f00769816fdf3dfb1e9763bba7 (patch) | |
tree | d96b69ccd9147ab28ede5b29b49d423d7e1d29ea /sql/rpl_utility.h | |
parent | 6c0abff9284511914e14ae9339f858101feca99a (diff) | |
download | mariadb-git-67f9a6d1782ff9f00769816fdf3dfb1e9763bba7.tar.gz |
Bug#42977 RBR logs for rows with more than 250 column results in corrupt binlog
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.
Diffstat (limited to 'sql/rpl_utility.h')
-rw-r--r-- | sql/rpl_utility.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 8e2f4a7374f..1f4ca246ff1 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -294,12 +294,14 @@ namespace { } #endif +// NB. number of printed bit values is limited to sizeof(buf) - 1 #define DBUG_PRINT_BITSET(N,FRM,BS) \ do { \ char buf[256]; \ - for (uint i = 0 ; i < (BS)->n_bits ; ++i) \ + uint i; \ + for (i = 0 ; i < min(sizeof(buf) - 1, (BS)->n_bits) ; i++) \ buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \ - buf[(BS)->n_bits] = '\0'; \ + buf[i] = '\0'; \ DBUG_PRINT((N), ((FRM), buf)); \ } while (0) |