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

Method _read_load_local_packet

pymysql/connections.py:1333–1353  ·  view source on GitHub ↗
(self, first_packet)

Source from the content-addressed store, hash-verified

1331 self.has_next = ok_packet.has_next
1332
1333 def _read_load_local_packet(self, first_packet):
1334 conn: Connection = self.connection
1335 if not conn._local_infile:
1336 raise RuntimeError(
1337 "**WARN**: Received LOAD_LOCAL packet but local_infile option is false."
1338 )
1339 load_packet = LoadLocalPacketWrapper(first_packet)
1340 try:
1341 _send_local_file(load_packet.filename, conn)
1342 finally:
1343 # send the empty packet to signify we are done sending data
1344 conn.write_packet(b"")
1345 ok_packet = conn._read_packet()
1346 # If an error occurs while sending the file, exit here without handling
1347 # the OK packet.
1348
1349 if not ok_packet.is_ok_packet():
1350 raise err.OperationalError(
1351 CR.CR_COMMANDS_OUT_OF_SYNC, "Commands Out of Sync"
1352 )
1353 self._read_ok_packet(ok_packet)
1354
1355 def _check_packet_is_eof(self, packet):
1356 if not packet.is_eof_packet():

Callers 2

readMethod · 0.95
init_unbuffered_queryMethod · 0.95

Calls 6

_read_ok_packetMethod · 0.95
_send_local_fileFunction · 0.85
write_packetMethod · 0.80
_read_packetMethod · 0.80
is_ok_packetMethod · 0.80

Tested by

no test coverage detected