Remove reference to connection soon when using buffered mode.

This commit is contained in:
INADA Naoki
2013-12-08 22:36:10 +09:00
parent 497bd0b2de
commit b8f3247065

View File

@@ -1051,13 +1051,16 @@ class MySQLResult(object):
self._finish_unbuffered_query()
def read(self):
first_packet = self.connection._read_packet()
try:
first_packet = self.connection._read_packet()
# TODO: use classes for different packet types?
if first_packet.is_ok_packet():
self._read_ok_packet(first_packet)
else:
self._read_result_packet(first_packet)
# TODO: use classes for different packet types?
if first_packet.is_ok_packet():
self._read_ok_packet(first_packet)
else:
self._read_result_packet(first_packet)
finally:
self.connection = False
def init_unbuffered_query(self):
self.unbuffered_active = True