MCPcopy
hub / github.com/PyMySQL/PyMySQL / init_unbuffered_query

Method init_unbuffered_query

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

1254 self.connection = None
1255
1256 def init_unbuffered_query(self):
1257 """
1258 :raise OperationalError: If the connection to the MySQL server is lost.
1259 :raise InternalError:
1260 """
1261 first_packet = self.connection._read_packet()
1262
1263 if first_packet.is_ok_packet():
1264 self.connection = None
1265 self._read_ok_packet(first_packet)
1266 elif first_packet.is_load_local_packet():
1267 try:
1268 self._read_load_local_packet(first_packet)
1269 finally:
1270 self.connection = None
1271 else:
1272 self.field_count = first_packet.read_length_encoded_integer()
1273 self._get_descriptions()
1274
1275 # Apparently, MySQLdb picks this number because it's the maximum
1276 # value of a 64bit unsigned integer. Since we're emulating MySQLdb,
1277 # we set it to this instead of None, which would be preferred.
1278 self.affected_rows = 18446744073709551615
1279 self.unbuffered_active = True
1280
1281 def _read_ok_packet(self, first_packet):
1282 ok_packet = OKPacketWrapper(first_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