Skip to content

Commit

Permalink
Revert moving call to recycleReadPacket(), to fix issues with binlog …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
fulghum committed Mar 4, 2025
1 parent 5cc89c1 commit f1072c8
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit f1072c8

Please sign in to comment.