Skip to content

Commit 6b6ce1e

Browse files
committed
Return ErrBadCon when buffer is in wrong state during interpolation
1 parent c48c0e7 commit 6b6ce1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

connection.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
209209
buf, err := mc.buf.takeCompleteBuffer()
210210
if err != nil {
211211
// can not take the buffer. Something must be wrong with the connection
212+
// is safe to retry and will help to recycle the TCP. So we can return ErrBadConn here
212213
mc.cfg.Logger.Print(err)
213-
return "", ErrInvalidConn
214+
return "", driver.ErrBadConn
214215
}
215216
buf = buf[:0]
216217
argPos := 0

0 commit comments

Comments
 (0)