(self, first_packet)
| 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(): |
no test coverage detected