Skip to content

Commit eabaab2

Browse files
committed
mini refactor
1 parent 51d2775 commit eabaab2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packets.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ func (mc *mysqlConn) readUntilEOF() (err error) {
629629
data, err = mc.readPacket()
630630

631631
// No Err and no EOF Packet
632-
if err == nil && (data[0] != iEOF) {
632+
if err == nil && data[0] != iEOF {
633633
continue
634634
}
635635
return // Err or EOF
@@ -667,15 +667,14 @@ func (stmt *mysqlStmt) readPrepareResultPacket() (columnCount uint16, err error)
667667
stmt.paramCount = int(binary.LittleEndian.Uint16(data[pos : pos+2]))
668668
pos += 2
669669

670-
// These 24 bits be here when > mysql4.1: see function send_prep_stmt() in sql/sql_prepare.cc
671-
// Guard against a 4.1 client [8 bit uint], always 0
670+
// Reserved [8 bit]
671+
pos++
672+
672673
// Warning count [16 bit uint]
673674
if !stmt.mc.strict {
674675
return
675676
} else {
676-
// See function cli_read_prepare_result() in libmysql/libmysql.c
677677
if len(data) >= 12 {
678-
pos++
679678
if binary.LittleEndian.Uint16(data[pos:pos+2]) > 0 {
680679
err = stmt.mc.getWarnings()
681680
}

0 commit comments

Comments
 (0)