File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ node-oracledb `v6.0.2 <https://github.com/oracle/node-oracledb/compare/v6.0.1...
11
11
Thin Mode Changes
12
12
+++++++++++++++++
13
13
14
+ #) Fixed bug when the length of a chunk inside a chunked read spans packets.
15
+ `Issue #1576 <https://github.com/oracle/node-oracledb/issues/1576 >`__.
16
+
14
17
#) Fixed bug when fetching rows containing data duplicated from a previous
15
18
row that spans multiple network packets.
16
19
`Issue #1566 <https://github.com/oracle/node-oracledb/issues/1566 >`__ and
Original file line number Diff line number Diff line change @@ -220,12 +220,17 @@ class ReadPacket extends BaseBuffer {
220
220
}
221
221
222
222
// the requested bytes are split across multiple packets; if a chunked read
223
- // is not in progress one is implicitly started; copy the bytes from the
224
- // end of this packet
225
- if ( ! inChunkedRead ) {
226
- this . chunkedBytesBuf . startChunkedRead ( ) ;
223
+ // is in progress, a chunk is acquired that will accommodate the requested
224
+ // bytes; otherwise, a separate buffer will be allocated to accommodate the
225
+ // requested bytes
226
+ let buf ;
227
+ if ( inChunkedRead ) {
228
+ buf = this . chunkedBytesBuf . getBuf ( numBytes ) ;
229
+ } else {
230
+ buf = Buffer . alloc ( numBytes ) ;
227
231
}
228
- const buf = this . chunkedBytesBuf . getBuf ( numBytes ) ;
232
+
233
+ // copy the bytes to the buffer from the remainder of this packet
229
234
let offset = 0 ;
230
235
this . buf . copy ( buf , offset , this . pos , this . pos + numBytesLeft ) ;
231
236
offset += numBytesLeft ;
@@ -241,10 +246,7 @@ class ReadPacket extends BaseBuffer {
241
246
numBytes -= numSplitBytes ;
242
247
}
243
248
244
- // if not in a chunked bytes read, return the buffer directly
245
- if ( ! inChunkedRead ) {
246
- return this . chunkedBytesBuf . endChunkedRead ( ) ;
247
- }
249
+ return buf ;
248
250
249
251
}
250
252
You can’t perform that action at this time.
0 commit comments