Skip to content

Commit

Permalink
Return ErrBadCon when buffer is in wrong state during interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
pfreixes committed Feb 2, 2024
1 parent c48c0e7 commit 6b6ce1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
buf, err := mc.buf.takeCompleteBuffer()
if err != nil {
// can not take the buffer. Something must be wrong with the connection
// is safe to retry and will help to recycle the TCP. So we can return ErrBadConn here
mc.cfg.Logger.Print(err)
return "", ErrInvalidConn
return "", driver.ErrBadConn
}
buf = buf[:0]
argPos := 0
Expand Down

0 comments on commit 6b6ce1e

Please sign in to comment.