MXS-1536: Add Annotate_rows event processing

The Annotate_rows events were not processed which caused the following
table map event to be ignored.

Also removed a false debug assertion. The byte count can be zero and the
pointer is not guaranteed to point to anything valid.
This commit is contained in:
Markus Mäkelä
2017-11-29 10:34:13 +02:00
parent 0ca04cb5d5
commit 764863cb3f
2 changed files with 7 additions and 1 deletions

View File

@ -665,6 +665,13 @@ avro_binlog_end_t avro_read_all_events(AVRO_INSTANCE *router)
snprintf(next_file, sizeof(next_file), BINLOG_NAMEFMT, router->fileroot, snprintf(next_file, sizeof(next_file), BINLOG_NAMEFMT, router->fileroot,
blr_file_get_next_binlogname(router->binlog_name)); blr_file_get_next_binlogname(router->binlog_name));
} }
else if (hdr.event_type == MARIADB_ANNOTATE_ROWS_EVENT)
{
MXS_INFO("Annotate_rows_event: %.*s", hdr.event_size - BINLOG_EVENT_HDR_LEN, ptr);
pos += original_size;
router->current_pos = pos;
continue;
}
else if (hdr.event_type == TABLE_MAP_EVENT) else if (hdr.event_type == TABLE_MAP_EVENT)
{ {
handle_table_map_event(router, &hdr, ptr); handle_table_map_event(router, &hdr, ptr);

View File

@ -588,7 +588,6 @@ uint8_t* process_row_event_data(TABLE_MAP *map, TABLE_CREATE *create, avro_value
} }
MXS_INFO("[%ld] CHAR: field: %d bytes, data: %d bytes", i, field_length, bytes); MXS_INFO("[%ld] CHAR: field: %d bytes, data: %d bytes", i, field_length, bytes);
ss_dassert(bytes || *ptr == '\0');
char str[bytes + 1]; char str[bytes + 1];
memcpy(str, ptr, bytes); memcpy(str, ptr, bytes);
str[bytes] = '\0'; str[bytes] = '\0';