Commit 6ae50d8a authored by He Zhenxing's avatar He Zhenxing

Postfix after merge semi-sync with heartbeat

Use ev_offset instead of 1 as the packet header offset when getting
log position from events for heartbeat

call reset_transmit_packet before calling send_heartbeat_event


sql/sql_repl.cc:
  Use ev_offset instead of 1 as the packet header offset when getting log position from events for heartbeat
  call reset_transmit_packet before calling send_heartbeat_event
parent e5e8f1a4
......@@ -427,7 +427,6 @@ static int send_heartbeat_event(NET* net, String* packet,
{
DBUG_RETURN(-1);
}
packet->set("\0", 1, &my_charset_bin);
DBUG_RETURN(0);
}
......@@ -689,7 +688,7 @@ impossible position";
log's filename does not change while it's active
*/
if (coord)
coord->pos= uint4korr(packet->ptr() + 1 + LOG_POS_OFFSET);
coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET);
event_type= (Log_event_type)((*packet)[LOG_EVENT_OFFSET+ev_offset]);
if (event_type == FORMAT_DESCRIPTION_EVENT)
......@@ -849,6 +848,9 @@ impossible position";
sql_print_information("the rest of heartbeat info skipped ...");
}
#endif
/* reset transmit packet for the heartbeat event */
if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg))
goto err;
if (send_heartbeat_event(net, packet, coord))
{
errmsg = "Failed on my_net_write()";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment