Skip to content

Commit 3140a83

Browse files
Fixed bug that prevented cursors from implicit results sets from being
closed.
1 parent d297f8b commit 3140a83

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Thin Mode Changes
2323
#) Fixed bug with re-execution of SQL that requires a define, such as occurs
2424
when setting `oracledb.defaults.fetch_lobs` to the value `False`
2525
(`issue 41 <https://github.com/oracle/python-oracledb/issues/41>`__).
26+
#) Fixed bug that prevented cursors from implicit results sets from being
27+
closed.
2628

2729
Common Changes
2830
++++++++++++++

src/oracledb/base_impl.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ cdef class BaseCursorImpl:
251251
uint32_t _buffer_index
252252
uint32_t _fetch_array_size
253253
bint _more_rows_to_fetch
254-
bint _is_implicit_cursor
255254

256255
cdef int _bind_values(self, object cursor, object type_handler,
257256
object params, uint32_t num_rows, uint32_t row_num,

src/oracledb/impl/thick/cursor.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
cdef class ThickCursorImpl(BaseCursorImpl):
3434
cdef:
3535
ThickConnImpl _conn_impl
36+
bint _is_implicit_cursor
3637
bint _fixup_ref_cursor
3738
dpiStmtInfo _stmt_info
3839
dpiStmt *_handle

src/oracledb/impl/thin/cursor.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ cdef class ThinCursorImpl(BaseCursorImpl):
4646

4747
cdef int _close(self, bint in_del) except -1:
4848
if self._statement is not None:
49-
if not self._is_implicit_cursor:
50-
self._conn_impl._return_statement(self._statement)
49+
self._conn_impl._return_statement(self._statement)
5150
self._statement = None
5251

5352
cdef BaseVarImpl _create_var_impl(self, object conn):
@@ -188,8 +187,7 @@ cdef class ThinCursorImpl(BaseCursorImpl):
188187
def prepare(self, str sql, str tag, bint cache_statement):
189188
self.statement = sql
190189
if self._statement is not None:
191-
if not self._is_implicit_cursor:
192-
self._conn_impl._return_statement(self._statement)
190+
self._conn_impl._return_statement(self._statement)
193191
self._statement = None
194192
self._statement = self._conn_impl._get_statement(sql.strip(),
195193
cache_statement)

src/oracledb/impl/thin/messages.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ cdef class MessageWithData(Message):
747747
child_cursor = self._create_cursor_from_describe(buf)
748748
child_cursor_impl = child_cursor._impl
749749
buf.read_ub2(&child_cursor_impl._statement._cursor_id)
750-
child_cursor_impl._is_implicit_cursor = True
751750
self.cursor_impl._implicit_resultsets.append(child_cursor)
752751

753752
cdef int _process_io_vector(self, ReadBuffer buf) except -1:

0 commit comments

Comments
 (0)