Skip to content

Commit 90db683

Browse files
committed
fix review points
1 parent 19dc2f7 commit 90db683

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packets.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,11 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
363363
}
364364
// MariaDB Extended Capabilities
365365
binary.LittleEndian.PutUint32(data[13+19:], uint32(mc.extCapabilities))
366-
pos += 4
367366
} else {
368367
for ; pos < 13+23; pos++ {
369368
data[pos] = 0
370369
}
371370
}
372-
// assert len(data) == pos
373371

374372
// SSL Connection Request Packet
375373
// https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_packets_protocol_ssl_request.html
@@ -707,7 +705,7 @@ func (mc *okHandler) handleOkPacket(data []byte) error {
707705
func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
708706
columns := make([]mysqlField, count)
709707

710-
for i := 0; i < count; i++ {
708+
for i := range count {
711709
data, err := mc.readPacket()
712710
if err != nil {
713711
return nil, err
@@ -905,6 +903,7 @@ func (mc *mysqlConn) skipPackets(n int) error {
905903
return nil
906904
}
907905

906+
// skips EOF packet after n * ColumnDefinition packets when clientDeprecateEOF is not set
908907
func (mc *mysqlConn) skipEof() error {
909908
if mc.capabilities&clientDeprecateEOF == 0 {
910909
if _, err := mc.readPacket(); err != nil {

0 commit comments

Comments
 (0)