Commit 724d5ae5 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

[MDEV-6877] Update binlog_prepare_pending_rows_events to use comparison function

When deciding which binlog events are pending, make use of the bitmap
compare function instead.
parent a7d181a0
...@@ -5919,13 +5919,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) ...@@ -5919,13 +5919,11 @@ int THD::decide_logging_format(TABLE_LIST *tables)
If error, NULL. If error, NULL.
*/ */
template <class RowsEventT> Rows_log_event* template <class RowsEventT> Rows_log_event*
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
MY_BITMAP const* cols,
size_t colcnt,
size_t needed, size_t needed,
bool is_transactional, bool is_transactional,
RowsEventT *hint __attribute__((unused))) RowsEventT *hint __attribute__((unused)))
{ {
DBUG_ENTER("binlog_prepare_pending_rows_event"); DBUG_ENTER("binlog_prepare_pending_rows_event");
/* Pre-conditions */ /* Pre-conditions */
...@@ -5961,16 +5959,15 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, ...@@ -5961,16 +5959,15 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
event. event.
*/ */
if (!pending || if (!pending ||
pending->server_id != serv_id || pending->server_id != serv_id ||
pending->get_table_id() != table->s->table_map_id || pending->get_table_id() != table->s->table_map_id ||
pending->get_general_type_code() != general_type_code || pending->get_general_type_code() != general_type_code ||
pending->get_data_size() + needed > opt_binlog_rows_event_max_size || pending->get_data_size() + needed > opt_binlog_rows_event_max_size ||
pending->get_width() != colcnt || pending->read_write_bitmaps_cmp(table) == FALSE)
!bitmap_cmp(pending->get_cols(), cols))
{ {
/* Create a new RowsEventT... */ /* Create a new RowsEventT... */
Rows_log_event* const Rows_log_event* const
ev= new RowsEventT(this, table, table->s->table_map_id, cols, ev= new RowsEventT(this, table, table->s->table_map_id,
is_transactional); is_transactional);
if (unlikely(!ev)) if (unlikely(!ev))
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
......
...@@ -2143,11 +2143,9 @@ public: ...@@ -2143,11 +2143,9 @@ public:
*/ */
template <class RowsEventT> Rows_log_event* template <class RowsEventT> Rows_log_event*
binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
MY_BITMAP const* cols,
size_t colcnt,
size_t needed, size_t needed,
bool is_transactional, bool is_transactional,
RowsEventT* hint); RowsEventT* hint);
Rows_log_event* binlog_get_pending_rows_event(bool is_transactional) const; Rows_log_event* binlog_get_pending_rows_event(bool is_transactional) const;
void binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional); void binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional);
inline int binlog_flush_pending_rows_event(bool stmt_end) inline int binlog_flush_pending_rows_event(bool stmt_end)
......
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