提交 2f354c21 编写于 作者: T Tao Liu

[TD-530] fix query result leaks bug

上级 5ed08273
......@@ -413,5 +413,5 @@ if __name__ == '__main__':
print(data)
cinter.freeresult(result)
cinter.freeResult(result)
cinter.close(conn)
\ No newline at end of file
......@@ -109,7 +109,6 @@ class TDengineCursor(object):
# TODO : change the exception raised here
raise ProgrammingError("Cursor is not connected")
self._connection.clear_result_set()
self._reset_result()
stmt = operation
......@@ -202,7 +201,7 @@ class TDengineCursor(object):
for i in range(len(self._fields)):
buffer[i].extend(block[i])
self._connection.clear_result_set()
self._reset_result()
return list(map(tuple, zip(*buffer)))
......@@ -222,6 +221,8 @@ class TDengineCursor(object):
"""
self._description = None
self._rowcount = -1
if self._result is not None:
CTaosInterface.freeResult(self._result)
self._result = None
self._fields = None
self._block = None
......
......@@ -413,5 +413,5 @@ if __name__ == '__main__':
print(data)
cinter.freeresult(result)
cinter.freeResult(result)
cinter.close(conn)
\ No newline at end of file
......@@ -111,7 +111,6 @@ class TDengineCursor(object):
# TODO : change the exception raised here
raise ProgrammingError("Cursor is not connected")
self._connection.clear_result_set()
self._reset_result()
stmt = operation
......@@ -204,7 +203,7 @@ class TDengineCursor(object):
for i in range(len(self._fields)):
buffer[i].extend(block[i])
self._connection.clear_result_set()
self._reset_result()
return list(map(tuple, zip(*buffer)))
......@@ -224,6 +223,8 @@ class TDengineCursor(object):
"""
self._description = None
self._rowcount = -1
if self._result is not None:
CTaosInterface.freeResult(self._result)
self._result = None
self._fields = None
self._block = None
......@@ -240,3 +241,4 @@ class TDengineCursor(object):
(ele['name'], ele['type'], None, None, None, None, False))
return self._result
......@@ -413,5 +413,5 @@ if __name__ == '__main__':
print(data)
cinter.freeresult(result)
cinter.freeResult(result)
cinter.close(conn)
\ No newline at end of file
......@@ -102,7 +102,6 @@ class TDengineCursor(object):
# TODO : change the exception raised here
raise ProgrammingError("Cursor is not connected")
self._connection.clear_result_set()
self._reset_result()
stmt = operation
......@@ -149,7 +148,7 @@ class TDengineCursor(object):
for i in range(len(self._fields)):
buffer[i].extend(block[i])
self._connection.clear_result_set()
self._reset_result()
return list(map(tuple, zip(*buffer)))
......@@ -171,6 +170,8 @@ class TDengineCursor(object):
"""
self._description = None
self._rowcount = -1
if self._result is not None:
CTaosInterface.freeResult(self._result)
self._result = None
self._fields = None
self._block = None
......
......@@ -413,5 +413,5 @@ if __name__ == '__main__':
print(data)
cinter.freeresult(result)
cinter.freeResult(result)
cinter.close(conn)
\ No newline at end of file
......@@ -102,7 +102,6 @@ class TDengineCursor(object):
# TODO : change the exception raised here
raise ProgrammingError("Cursor is not connected")
self._connection.clear_result_set()
self._reset_result()
stmt = operation
......@@ -149,7 +148,7 @@ class TDengineCursor(object):
for i in range(len(self._fields)):
buffer[i].extend(block[i])
self._connection.clear_result_set()
self._reset_result()
return list(map(tuple, zip(*buffer)))
......@@ -171,6 +170,8 @@ class TDengineCursor(object):
"""
self._description = None
self._rowcount = -1
if self._result is not None:
CTaosInterface.freeResult(self._result)
self._result = None
self._fields = None
self._block = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册