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

Method writeCommandPacketUint32

packets.go:475–494  ·  view source on GitHub ↗
(command byte, arg uint32)

Source from the content-addressed store, hash-verified

473}
474
475func (mc *mysqlConn) writeCommandPacketUint32(command byte, arg uint32) error {
476 // Reset Packet Sequence
477 mc.resetSequence()
478
479 data, err := mc.buf.takeSmallBuffer(4 + 1 + 4)
480 if err != nil {
481 return err
482 }
483
484 // Add command byte
485 data[4] = command
486
487 // Add arg [32 bit]
488 binary.LittleEndian.PutUint32(data[5:], arg)
489
490 // Send CMD packet
491 err = mc.writePacket(data)
492 mc.syncSequence()
493 return err
494}
495
496/******************************************************************************
497* Result Packets *

Callers 1

CloseMethod · 0.80

Calls 4

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

Tested by

no test coverage detected