MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / write_packet

Method write_packet

pymysql/connections.py:761–771  ·  view source on GitHub ↗

Writes an entire "mysql packet" in its entirety to the network adding its length and sequence number.

(self, payload)

Source from the content-addressed store, hash-verified

759 raise
760
761 def write_packet(self, payload):
762 """Writes an entire "mysql packet" in its entirety to the network
763 adding its length and sequence number.
764 """
765 # Internal note: when you build packet manually and calls _write_bytes()
766 # directly, you should set self._next_seq_id properly.
767 data = _pack_int24(len(payload)) + bytes([self._next_seq_id]) + payload
768 if DEBUG:
769 dump_packet(data)
770 self._write_bytes(data)
771 self._next_seq_id = (self._next_seq_id + 1) % 256
772
773 def _read_packet(self, packet_type=MysqlPacket):
774 """Read an entire "mysql packet" in its entirety from the network

Callers 7

_execute_commandMethod · 0.95
_process_authMethod · 0.95
_roundtripFunction · 0.80
_send_local_fileFunction · 0.80
authenticateMethod · 0.80

Calls 3

_write_bytesMethod · 0.95
_pack_int24Function · 0.85
dump_packetFunction · 0.85

Tested by 1

authenticateMethod · 0.64