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

Method _read_load_local_packet

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

Source from the content-addressed store, hash-verified

1343 self.has_next = ok_packet.has_next
1344
1345 def _read_load_local_packet(self, first_packet):
1346 conn: Connection = self.connection
1347 if not conn._local_infile:
1348 raise RuntimeError(
1349 "**WARN**: Received LOAD_LOCAL packet but local_infile option is false."
1350 )
1351 load_packet = LoadLocalPacketWrapper(first_packet)
1352 try:
1353 _send_local_file(load_packet.filename, conn)
1354 finally:
1355 # send the empty packet to signify we are done sending data
1356 conn.write_packet(b"")
1357 ok_packet = conn._read_packet()
1358 # If an error occurs while sending the file, exit here without handling
1359 # the OK packet.
1360
1361 if not ok_packet.is_ok_packet():
1362 raise err.OperationalError(
1363 CR.CR_COMMANDS_OUT_OF_SYNC, "Commands Out of Sync"
1364 )
1365 self._read_ok_packet(ok_packet)
1366
1367 def _check_packet_is_eof(self, packet):
1368 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