We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94d8ccd commit f58f76cCopy full SHA for f58f76c
packets.go
@@ -131,7 +131,9 @@ func (mc *mysqlConn) writePacket(data []byte) error {
131
}
132
return err
133
134
- if n != size+4 {
+ if n != 4+size {
135
+ // io.Writer(b) must return a non-nil error if it cannot write len(b) bytes.
136
+ // The io.ErrShortWrite error is used to indicate that this rule has not been followed.
137
mc.cleanup()
138
return io.ErrShortWrite
139
@@ -142,7 +144,6 @@ func (mc *mysqlConn) writePacket(data []byte) error {
142
144
143
145
pktLen -= size
146
data = data[size:]
- continue
147
148
149
0 commit comments