Skip to content

Commit fbeda64

Browse files
committed
Fix cursor leak during an error
1 parent 4b2661f commit fbeda64

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/src/release_notes.rst

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ node-oracledb `v6.0.1 <https://github.com/oracle/node-oracledb/compare/v6.0.0...
2121
#) Added clear error message when an attempt is made to establish a connection
2222
with an unsupported database version in Thin mode.
2323

24+
#) Fixed bug which caused a cursor leak if an error was thrown while
25+
processing the execution of a query.
26+
2427
#) The buffer and process modules are now imported consistently instead of
2528
relying on global variable definitions, as suggested by Sławomir Osoba in
2629
`GitHub pull request #1559

lib/thin/protocol/messages/withData.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ class MessageWithData extends Message {
9696

9797
processErrorInfo(buf) {
9898
super.processErrorInfo(buf);
99-
this.statement.cursorId = this.errorInfo.cursorId;
99+
if (this.errorInfo.cursorId !== 0) {
100+
this.statement.cursorId = this.errorInfo.cursorId;
101+
}
100102
if (!this.statement.isPlSql) {
101103
this.statement.rowCount = this.errorInfo.rowCount;
102104
}

0 commit comments

Comments
 (0)