Skip to content

Commit 20c8f2d

Browse files
committed
fix interpolateParams
1 parent db0cc0e commit 20c8f2d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

connection.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
207207
if err != nil {
208208
// can not take the buffer. Something must be wrong with the connection
209209
mc.cleanup()
210-
return "", err
210+
// interpolateParams would be called before sending any query.
211+
// So its safe to retry.
212+
mc.log(err)
213+
return "", driver.ErrBadConn
211214
}
212215
buf = buf[:0]
213216
argPos := 0

0 commit comments

Comments
 (0)