diff --git a/buffer.go b/buffer.go index c2609219..040c092c 100644 --- a/buffer.go +++ b/buffer.go @@ -150,11 +150,8 @@ func (b *buffer) takeCompleteBuffer() ([]byte, error) { } // store stores buf, an updated buffer, if its suitable to do so. -func (b *buffer) store(buf []byte) error { - if b.busy() { - return ErrBusyBuffer - } else if cap(buf) <= maxCachedBufSize && cap(buf) > cap(b.cachedBuf) { +func (b *buffer) store(buf []byte) { + if cap(buf) <= maxCachedBufSize && cap(buf) > cap(b.cachedBuf) { b.cachedBuf = buf[:cap(buf)] } - return nil } diff --git a/packets.go b/packets.go index 4695fb81..736e4418 100644 --- a/packets.go +++ b/packets.go @@ -1191,9 +1191,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error { // In that case we must build the data packet with the new values buffer if valuesCap != cap(paramValues) { data = append(data[:pos], paramValues...) - if err = mc.buf.store(data); err != nil { - return err - } + mc.buf.store(data) // allow this buffer to be reused } pos += len(paramValues)