Skip to content

Commit aa42ae8

Browse files
Fixed bug which caused a cursor leak if an error was thrown while
processing the execution of a query.
1 parent e0f06db commit aa42ae8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

doc/src/release_notes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Thin Mode Changes
1515

1616
#) Fixed bug connecting to databases with older 11g password verifiers
1717
(`issue 189 <https://github.com/oracle/python-oracledb/issues/189>`__).
18+
#) Fixed bug which caused a cursor leak if an error was thrown while
19+
processing the execution of a query.
1820
#) Fixed bugs in the implementation of the statement cache.
1921

2022
Thick Mode Changes

src/oracledb/impl/thin/messages.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,8 @@ cdef class MessageWithData(Message):
741741
ThinConnImpl conn_impl = self.conn_impl
742742
object exc_type
743743
Message._process_error_info(self, buf)
744-
cursor_impl._statement._cursor_id = self.error_info.cursor_id
744+
if self.error_info.cursor_id != 0:
745+
cursor_impl._statement._cursor_id = self.error_info.cursor_id
745746
if not cursor_impl._statement._is_plsql and not self.in_fetch:
746747
cursor_impl.rowcount = self.error_info.rowcount
747748
cursor_impl._lastrowid = self.error_info.rowid

0 commit comments

Comments
 (0)