Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.1.12
-
None
Description
When mariadb server has binlog_checksum=NONE, mariadb_rpl_fetch is still assuming there's a checksum at the end of the packet, and gives 4 bytes too short SQL in QUERY_EVENT and ANNOTATE_ROWS_EVENT.
It seems to be caused at line 238 in mariadb_rpl.c
/* calculate statement size: buffer + buffer_size - current_ofs (ev) - crc_size */ |
len= (size_t)(rpl->buffer + rpl->buffer_size - ev - 4); |
Which should have been
len= (size_t)(rpl->buffer + rpl->buffer_size - ev - (rpl->use_checksum ? 4 : 0)); |
And for ANNOTATE_ROWS_EVENT, at line 305:
len= (uint32)(rpl->buffer + rpl->buffer_size - (unsigned char *)ev - 4); |
which should be, similarly:
len= (uint32)(rpl->buffer + rpl->buffer_size - (unsigned char *)ev - (rpl->use_checksum ? 4 : 0)); |