Created
July 21, 2021 23:42
-
-
Save cjbj/f778f9a851ce800f53a4effb5bce1ae2 to your computer and use it in GitHub Desktop.
Patch for node-oracledb 5.2 issue #1391
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/queryStream.js b/lib/queryStream.js | |
index 08ddc72..09efc99 100644 | |
--- a/lib/queryStream.js | |
+++ b/lib/queryStream.js | |
@@ -89,11 +89,6 @@ class QueryStream extends Readable { | |
this._fetching = true; | |
this._resultSet._allowGetRowCall = true; | |
const row = await this._resultSet.getRow(); | |
- this._fetching = false; | |
- if (!this._resultSet) { | |
- this.emit('_doneFetching'); | |
- return; | |
- } | |
if (row) { | |
this.push(row); | |
} else { | |
@@ -101,6 +96,13 @@ class QueryStream extends Readable { | |
} | |
} catch (err) { | |
this.destroy(err); | |
+ } finally { | |
+ this._fetching = false; | |
+ if (this.resultSet) { | |
+ this._resultSet._allowGetRowCall = false; | |
+ } else { | |
+ this.emit('_doneFetching'); | |
+ } | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment