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

Method init_unbuffered_query

pymysql/connections.py:1311–1334  ·  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

1309 self.connection = None
1310
1311 def init_unbuffered_query(self):
1312 """
1313 :raise OperationalError: If the connection to the MySQL server is lost.
1314 :raise InternalError:
1315 """
1316 first_packet = self.connection._read_packet()
1317
1318 if first_packet.is_ok_packet():
1319 self.connection = None
1320 self._read_ok_packet(first_packet)
1321 elif first_packet.is_load_local_packet():
1322 try:
1323 self._read_load_local_packet(first_packet)
1324 finally:
1325 self.connection = None
1326 else:
1327 self.field_count = first_packet.read_length_encoded_integer()
1328 self._get_descriptions()
1329
1330 # Apparently, MySQLdb picks this number because it's the maximum
1331 # value of a 64bit unsigned integer. Since we're emulating MySQLdb,
1332 # we set it to this instead of None, which would be preferred.
1333 self.affected_rows = 18446744073709551615
1334 self.unbuffered_active = True
1335
1336 def _read_ok_packet(self, packet):
1337 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