MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / init_unbuffered_query

Method init_unbuffered_query

pager_lib/pymysql/connections.py:1214–1237  ·  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

1212 self.connection = None
1213
1214 def init_unbuffered_query(self):
1215 """
1216 :raise OperationalError: If the connection to the MySQL server is lost.
1217 :raise InternalError:
1218 """
1219 first_packet = self.connection._read_packet()
1220
1221 if first_packet.is_ok_packet():
1222 self.connection = None
1223 self._read_ok_packet(first_packet)
1224 elif first_packet.is_load_local_packet():
1225 try:
1226 self._read_load_local_packet(first_packet)
1227 finally:
1228 self.connection = None
1229 else:
1230 self.field_count = first_packet.read_length_encoded_integer()
1231 self._get_descriptions()
1232
1233 # Apparently, MySQLdb picks this number because it's the maximum
1234 # value of a 64bit unsigned integer. Since we're emulating MySQLdb,
1235 # we set it to this instead of None, which would be preferred.
1236 self.affected_rows = 18446744073709551615
1237 self.unbuffered_active = True
1238
1239 def _read_ok_packet(self, first_packet):
1240 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