:raise OperationalError: If the connection to the MySQL server is lost. :raise InternalError:
(self)
| 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) |
no test coverage detected