Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions go/mysql/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1394,15 +1394,13 @@ func (c *Conn) handleNextCommand(ctx context.Context, handler Handler) error {

case ComBinlogDumpGTID:
ok := c.handleComBinlogDumpGTID(handler, data)
c.recycleReadPacket()
if !ok {
return fmt.Errorf("error handling ComBinlogDumpGTID packet")
}
return nil

case ComRegisterReplica:
ok := c.handleComRegisterReplica(handler, data)
c.recycleReadPacket()
if !ok {
return fmt.Errorf("error handling ComRegisterReplica packet")
}
Expand Down Expand Up @@ -1433,6 +1431,8 @@ func (c *Conn) handleComRegisterReplica(handler Handler, data []byte) (kontinue
return false
}

c.recycleReadPacket()

if err := binlogReplicaHandler.ComRegisterReplica(c, replicaHost, replicaPort, replicaUser, replicaPassword); err != nil {
c.writeErrorPacketFromError(err)
return false
Expand Down Expand Up @@ -1467,6 +1467,8 @@ func (c *Conn) handleComBinlogDumpGTID(handler Handler, data []byte) (kontinue b
return false
}

c.recycleReadPacket()

if err := binlogReplicaHandler.ComBinlogDumpGTID(c, logFile, logPos, position.GTIDSet); err != nil {
log.Error(err.Error())
c.writeErrorPacketFromError(err)
Expand Down