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

Method _finish_unbuffered_query

pymysql/connections.py:1349–1370  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1347 return row
1348
1349 def _finish_unbuffered_query(self):
1350 # After much reading on the MySQL protocol, it appears that there is,
1351 # in fact, no way to stop MySQL from sending all the data after
1352 # executing a query, so we just spin, and wait for an EOF packet.
1353 while self.unbuffered_active:
1354 try:
1355 packet = self.connection._read_packet()
1356 except err.OperationalError as e:
1357 if e.args[0] in (
1358 ER.QUERY_TIMEOUT,
1359 ER.STATEMENT_TIMEOUT,
1360 ):
1361 # if the query timed out we can simply ignore this error
1362 self.unbuffered_active = False
1363 self.connection = None
1364 return
1365
1366 raise
1367
1368 if self._check_packet_is_eof(packet):
1369 self.unbuffered_active = False
1370 self.connection = None # release reference to kill cyclic reference.
1371
1372 def _read_rowdata_packet(self):
1373 """Read a rowdata packet for each data row in the result set."""

Callers 3

__del__Method · 0.95
_execute_commandMethod · 0.80
closeMethod · 0.80

Calls 2

_check_packet_is_eofMethod · 0.95
_read_packetMethod · 0.80

Tested by

no test coverage detected