Skip to content

Commit

Permalink
[MDEV-6877] Fixed Assertion Error, when receiving an empty event
Browse files Browse the repository at this point in the history
Due to how events are created with a minimal binlog_row_image, it is
possible to receive empty write events because all the columns
in the table have a default value. (For example an auto-increment)
Make sure we account for that.
  • Loading branch information
cvicentiu committed Jun 30, 2015
1 parent ca27672 commit 5095507
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sql/log_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9499,6 +9499,18 @@ int Rows_log_event::do_add_row_data(uchar *row_data, size_t length)
DBUG_ENTER("Rows_log_event::do_add_row_data");
DBUG_PRINT("enter", ("row_data: 0x%lx length: %lu", (ulong) row_data,
(ulong) length));

/*
If length is zero, there is nothing to write, so we just
return. Note that this is not an optimization, since calling
realloc() with size 0 means free().
*/
if (length == 0)
{
m_row_count++;
DBUG_RETURN(0);
}

/*
Don't print debug messages when running valgrind since they can
trigger false warnings.
Expand Down Expand Up @@ -12374,7 +12386,7 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
able to skip to the next pair of updates
*/
m_curr_row= m_curr_row_end;
unpack_current_row(rgi);
unpack_current_row(rgi, &m_cols_ai);
thd_proc_info(thd, tmp);
return error;
}
Expand Down

0 comments on commit 5095507

Please sign in to comment.