File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,8 @@ func (b *buffer) takeCompleteBuffer() ([]byte, error) {
150150}
151151
152152// store stores buf, an updated buffer, if its suitable to do so.
153- func (b * buffer ) store (buf []byte ) error {
154- if b .busy () {
155- return ErrBusyBuffer
156- } else if cap (buf ) <= maxCachedBufSize && cap (buf ) > cap (b .cachedBuf ) {
153+ func (b * buffer ) store (buf []byte ) {
154+ if cap (buf ) <= maxCachedBufSize && cap (buf ) > cap (b .cachedBuf ) {
157155 b .cachedBuf = buf [:cap (buf )]
158156 }
159- return nil
160157}
Original file line number Diff line number Diff line change @@ -1191,9 +1191,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
11911191 // In that case we must build the data packet with the new values buffer
11921192 if valuesCap != cap (paramValues ) {
11931193 data = append (data [:pos ], paramValues ... )
1194- if err = mc .buf .store (data ); err != nil {
1195- return err
1196- }
1194+ mc .buf .store (data ) // allow this buffer to be reused
11971195 }
11981196
11991197 pos += len (paramValues )
You can’t perform that action at this time.
0 commit comments