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

Method init_unbuffered_query

pymysql/connections.py:1299–1322  ·  view source on GitHub ↗

:raise OperationalError: If the connection to the MySQL server is lost. :raise InternalError:

(self)

Source from the content-addressed store, hash-verified

1297 self.connection = None
1298
1299 def init_unbuffered_query(self):
1300 """
1301 :raise OperationalError: If the connection to the MySQL server is lost.
1302 :raise InternalError:
1303 """
1304 first_packet = self.connection._read_packet()
1305
1306 if first_packet.is_ok_packet():
1307 self.connection = None
1308 self._read_ok_packet(first_packet)
1309 elif first_packet.is_load_local_packet():
1310 try:
1311 self._read_load_local_packet(first_packet)
1312 finally:
1313 self.connection = None
1314 else:
1315 self.field_count = first_packet.read_length_encoded_integer()
1316 self._get_descriptions()
1317
1318 # Apparently, MySQLdb picks this number because it's the maximum
1319 # value of a 64bit unsigned integer. Since we're emulating MySQLdb,
1320 # we set it to this instead of None, which would be preferred.
1321 self.affected_rows = 18446744073709551615
1322 self.unbuffered_active = True
1323
1324 def _read_ok_packet(self, packet):
1325 ok_packet = OKPacketWrapper(packet)

Callers 1

_read_query_resultMethod · 0.95

Calls 7

_read_ok_packetMethod · 0.95
_get_descriptionsMethod · 0.95
_read_packetMethod · 0.80
is_ok_packetMethod · 0.80
is_load_local_packetMethod · 0.80

Tested by

no test coverage detected