Skip to content

Commit 916d7c9

Browse files
committed
fix code style
1 parent eabaab2 commit 916d7c9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packets.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,9 @@ func (stmt *mysqlStmt) readPrepareResultPacket() (columnCount uint16, err error)
674674
if !stmt.mc.strict {
675675
return
676676
} else {
677-
if len(data) >= 12 {
678-
if binary.LittleEndian.Uint16(data[pos:pos+2]) > 0 {
679-
err = stmt.mc.getWarnings()
680-
}
677+
// Check for warnings count > 0, only available in MySQL > 4.1
678+
if len(data) >= 12 && binary.LittleEndian.Uint16(data[pos:pos+2]) > 0 {
679+
err = stmt.mc.getWarnings()
681680
}
682681
}
683682
}

0 commit comments

Comments
 (0)