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) {
150
150
}
151
151
152
152
// 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 ) {
157
155
b .cachedBuf = buf [:cap (buf )]
158
156
}
159
- return nil
160
157
}
Original file line number Diff line number Diff line change @@ -1191,9 +1191,7 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
1191
1191
// In that case we must build the data packet with the new values buffer
1192
1192
if valuesCap != cap (paramValues ) {
1193
1193
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
1197
1195
}
1198
1196
1199
1197
pos += len (paramValues )
You can’t perform that action at this time.
0 commit comments