MCPcopy Index your code
hub / github.com/PyMySQL/PyMySQL / _read_load_local_packet

Method _read_load_local_packet

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

Source from the content-addressed store, hash-verified

1288 self.has_next = ok_packet.has_next
1289
1290 def _read_load_local_packet(self, first_packet):
1291 if not self.connection._local_infile:
1292 raise RuntimeError(
1293 "**WARN**: Received LOAD_LOCAL packet but local_infile option is false."
1294 )
1295 load_packet = LoadLocalPacketWrapper(first_packet)
1296 sender = LoadLocalFile(load_packet.filename, self.connection)
1297 try:
1298 sender.send_data()
1299 except:
1300 self.connection._read_packet() # skip ok packet
1301 raise
1302
1303 ok_packet = self.connection._read_packet()
1304 if (
1305 not ok_packet.is_ok_packet()
1306 ): # pragma: no cover - upstream induced protocol error
1307 raise err.OperationalError(
1308 CR.CR_COMMANDS_OUT_OF_SYNC,
1309 "Commands Out of Sync",
1310 )
1311 self._read_ok_packet(ok_packet)
1312
1313 def _check_packet_is_eof(self, packet):
1314 if not packet.is_eof_packet():

Callers 2

readMethod · 0.95
init_unbuffered_queryMethod · 0.95

Calls 6

send_dataMethod · 0.95
_read_ok_packetMethod · 0.95
LoadLocalFileClass · 0.85
_read_packetMethod · 0.80
is_ok_packetMethod · 0.80

Tested by

no test coverage detected