Commit a7d181a0 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

[MDEV-6877] Added a bitmap compare function for binlog_row_image

The function compares bitmaps according to the binlog_row_image variable
setting.
parent c096caee
......@@ -4264,9 +4264,58 @@ public:
virtual int get_data_size();
MY_BITMAP const *get_cols() const { return &m_cols; }
MY_BITMAP const *get_cols_ai() const { return &m_cols_ai; }
size_t get_width() const { return m_width; }
ulong get_table_id() const { return m_table_id; }
#if defined(MYSQL_SERVER)
/*
This member function compares the table's read/write_set
with this event's m_cols and m_cols_ai. Comparison takes
into account what type of rows event is this: Delete, Write or
Update, therefore it uses the correct m_cols[_ai] according
to the event type code.
Note that this member function should only be called for the
following events:
- Delete_rows_log_event
- Write_rows_log_event
- Update_rows_log_event
@param[IN] table The table to compare this events bitmaps
against.
@return TRUE if sets match, FALSE otherwise. (following
bitmap_cmp return logic).
*/
virtual bool read_write_bitmaps_cmp(TABLE *table)
{
bool res= FALSE;
switch (get_general_type_code())
{
case DELETE_ROWS_EVENT:
res= bitmap_cmp(get_cols(), table->read_set);
break;
case UPDATE_ROWS_EVENT:
res= (bitmap_cmp(get_cols(), table->read_set) &&
bitmap_cmp(get_cols_ai(), table->write_set));
break;
case WRITE_ROWS_EVENT:
res= bitmap_cmp(get_cols(), table->write_set);
break;
default:
/*
We should just compare bitmaps for Delete, Write
or Update rows events.
*/
DBUG_ASSERT(0);
}
return res;
}
#endif
#ifdef MYSQL_SERVER
virtual bool write_data_header(IO_CACHE *file);
virtual bool write_data_body(IO_CACHE *file);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment