We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60d456a commit b0940b6Copy full SHA for b0940b6
buffer.go
@@ -37,6 +37,12 @@ func newBuffer(nc net.Conn) buffer {
37
}
38
39
40
+func (b *buffer) reset() {
41
+ b.buf = make([]byte, defaultBufSize)
42
+ b.idx = 0
43
+ b.length = 0
44
+}
45
+
46
// fill reads into the buffer until at least _need_ bytes are in it
47
func (b *buffer) fill(need int) error {
48
n := b.length
rows.go
@@ -111,6 +111,10 @@ func (rows *mysqlRows) Close() (err error) {
111
return err
112
113
114
+ // We can't reuse receive buffer when rows.Close() is called.
115
+ // See https://github.com/golang/go/commit/651ddbdb5056ded455f47f9c494c67b389622a47
116
+ mc.buf.reset()
117
118
// Remove unread packets from stream
119
if !rows.rs.done {
120
err = mc.readUntilEOF()
0 commit comments