Explorar o código

mini refactor

s7v7nislands %!s(int64=12) %!d(string=hai) anos
pai
achega
eabaab2d9c
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  1. 4 5
      packets.go

+ 4 - 5
packets.go

@@ -629,7 +629,7 @@ func (mc *mysqlConn) readUntilEOF() (err error) {
 		data, err = mc.readPacket()
 
 		// No Err and no EOF Packet
-		if err == nil && (data[0] != iEOF) {
+		if err == nil && data[0] != iEOF {
 			continue
 		}
 		return // Err or EOF
@@ -667,15 +667,14 @@ func (stmt *mysqlStmt) readPrepareResultPacket() (columnCount uint16, err error)
 		stmt.paramCount = int(binary.LittleEndian.Uint16(data[pos : pos+2]))
 		pos += 2
 
-		// These 24 bits be here when > mysql4.1: see function send_prep_stmt() in sql/sql_prepare.cc
-		// Guard against a 4.1 client [8 bit uint], always 0
+		// Reserved [8 bit]
+		pos++
+
 		// Warning count [16 bit uint]
 		if !stmt.mc.strict {
 			return
 		} else {
-			// See function cli_read_prepare_result() in libmysql/libmysql.c
 			if len(data) >= 12 {
-				pos++
 				if binary.LittleEndian.Uint16(data[pos:pos+2]) > 0 {
 					err = stmt.mc.getWarnings()
 				}