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