File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -748,26 +748,13 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
748
748
if len (args ) == 0 {
749
749
const pktLen = 1 + 4 + 1 + 4
750
750
data = mc .buf .takeBuffer (4 + pktLen )
751
- if data == nil {
752
- // can not take the buffer. Something must be wrong with the connection
753
- errLog .Print ("Busy buffer" )
754
- return driver .ErrBadConn
755
- }
756
-
757
- // packet header [4 bytes]
758
- data [0 ] = byte (pktLen )
759
- data [1 ] = byte (pktLen >> 8 )
760
- data [2 ] = byte (pktLen >> 16 )
761
- data [3 ] = 0x00 // new command, sequence id is always 0
762
751
} else {
763
752
data = mc .buf .takeCompleteBuffer ()
764
- if data == nil {
765
- // can not take the buffer. Something must be wrong with the connection
766
- errLog .Print ("Busy buffer" )
767
- return driver .ErrBadConn
768
- }
769
-
770
- // header (bytes 0-3) is added after we know the packet size
753
+ }
754
+ if data == nil {
755
+ // can not take the buffer. Something must be wrong with the connection
756
+ errLog .Print ("Busy buffer" )
757
+ return driver .ErrBadConn
771
758
}
772
759
773
760
// command [1 byte]
You can’t perform that action at this time.
0 commit comments