1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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

The function compares bitmaps according to the binlog_row_image variable
setting.
This commit is contained in:
Vicențiu Ciorbaru
2015-04-02 19:31:51 +03:00
parent c096caee71
commit a7d181a023

View File

@@ -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);