MCPcopy
hub / github.com/go-sql-driver/mysql / writeCommandPacket

Method writeCommandPacket

packets.go:435–451  ·  view source on GitHub ↗

****************************************************************************** * Command Packets * ******************************************************************************/

(command byte)

Source from the content-addressed store, hash-verified

433******************************************************************************/
434
435func (mc *mysqlConn) writeCommandPacket(command byte) error {
436 // Reset Packet Sequence
437 mc.resetSequence()
438
439 data, err := mc.buf.takeSmallBuffer(4 + 1)
440 if err != nil {
441 return err
442 }
443
444 // Add command byte
445 data[4] = command
446
447 // Send CMD packet
448 err = mc.writePacket(data)
449 mc.syncSequence()
450 return err
451}
452
453func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error {
454 // Reset Packet Sequence

Callers 2

CloseMethod · 0.95
PingMethod · 0.95

Calls 4

resetSequenceMethod · 0.95
writePacketMethod · 0.95
syncSequenceMethod · 0.95
takeSmallBufferMethod · 0.80

Tested by

no test coverage detected