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

Method writeCommandPacketStr

packets.go:453–473  ·  view source on GitHub ↗
(command byte, arg string)

Source from the content-addressed store, hash-verified

451}
452
453func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error {
454 // Reset Packet Sequence
455 mc.resetSequence()
456
457 pktLen := 1 + len(arg)
458 data, err := mc.buf.takeBuffer(pktLen + 4)
459 if err != nil {
460 return err
461 }
462
463 // Add command byte
464 data[4] = command
465
466 // Add arg
467 copy(data[5:], arg)
468
469 // Send CMD packet
470 err = mc.writePacket(data)
471 mc.syncSequence()
472 return err
473}
474
475func (mc *mysqlConn) writeCommandPacketUint32(command byte, arg uint32) error {
476 // Reset Packet Sequence

Callers 4

PrepareMethod · 0.95
execMethod · 0.95
queryMethod · 0.95
getSystemVarMethod · 0.95

Calls 4

resetSequenceMethod · 0.95
writePacketMethod · 0.95
syncSequenceMethod · 0.95
takeBufferMethod · 0.80

Tested by

no test coverage detected