1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

[MDEV-6877] Fixed Assertion Error, when receiving an empty event

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.
This commit is contained in:
Vicențiu Ciorbaru
2015-04-14 15:05:14 +03:00
parent ca276729bc
commit 50955075bb

View File

@@ -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.
@@ -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;
}