You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Replication/Binlog API fix:
When sending filename in SEMI_SYNC_REQUEST to the server, we don't need to send additional terminating zero in filename. See https://mariadb.com/kb/en/4-semi-sync-replication/
This commit is contained in:
@@ -1814,13 +1814,12 @@ MARIADB_RPL_EVENT * STDCALL mariadb_rpl_fetch(MARIADB_RPL *rpl, MARIADB_RPL_EVEN
|
|||||||
if (rpl_event->is_semi_sync &&
|
if (rpl_event->is_semi_sync &&
|
||||||
rpl_event->semi_sync_flags == SEMI_SYNC_ACK_REQ)
|
rpl_event->semi_sync_flags == SEMI_SYNC_ACK_REQ)
|
||||||
{
|
{
|
||||||
size_t buf_size= rpl->filename_length + 1 + 9;
|
size_t buf_size= rpl->filename_length + 1 + 8;
|
||||||
uchar *buffer= alloca(buf_size);
|
uchar *buffer= alloca(buf_size);
|
||||||
|
|
||||||
buffer[0]= SEMI_SYNC_INDICATOR;
|
buffer[0]= SEMI_SYNC_INDICATOR;
|
||||||
int8store(buffer + 1, (int64_t)rpl_event->next_event_pos);
|
int8store(buffer + 1, (int64_t)rpl_event->next_event_pos);
|
||||||
memcpy(buffer + 9, rpl->filename, rpl->filename_length);
|
memcpy(buffer + 9, rpl->filename, rpl->filename_length);
|
||||||
buffer[buf_size - 1]= 0;
|
|
||||||
|
|
||||||
/* clear network buffer before sending the reply packet*/
|
/* clear network buffer before sending the reply packet*/
|
||||||
ma_net_clear(&rpl->mysql->net);
|
ma_net_clear(&rpl->mysql->net);
|
||||||
|
Reference in New Issue
Block a user