****************************************************************************** * Command Packets * ******************************************************************************/
(command byte)
| 433 | ******************************************************************************/ |
| 434 | |
| 435 | func (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 | |
| 453 | func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error { |
| 454 | // Reset Packet Sequence |
no test coverage detected