Skip to content

Commit

Permalink
Merge pull request #401 from dolthub/fulghum/revert
Browse files Browse the repository at this point in the history
Revert moving call to `recycleReadPacket()`
  • Loading branch information
fulghum authored Mar 4, 2025
2 parents 5cc89c1 + f1072c8 commit 920ca9e
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 920ca9e

Please sign in to comment.