summaryrefslogtreecommitdiff
path: root/sql/rpl_utility.h
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2009-03-25 12:53:56 +0200
committerAndrei Elkin <aelkin@mysql.com>2009-03-25 12:53:56 +0200
commit921e3fe8bf67105f7ac28d5d4bf990ee754de5d4 (patch)
treed96b69ccd9147ab28ede5b29b49d423d7e1d29ea /sql/rpl_utility.h
parent18d22198890d980be7583413ff51d35480ae6922 (diff)
downloadmariadb-git-921e3fe8bf67105f7ac28d5d4bf990ee754de5d4.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.
Diffstat (limited to 'sql/rpl_utility.h')
-rw-r--r--sql/rpl_utility.h6
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)