File tree Expand file tree Collapse file tree 5 files changed +26
-1
lines changed Expand file tree Collapse file tree 5 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ Thick Mode Changes
38
38
Additionally, this fix resolves the issue related to JS numbers with
39
39
precisions where `2.3 ` is returned as `2.300003 `.
40
40
41
+ #) Fixed a regression that caused ``deqOne()``and ``deqMany() `` to return an
42
+ invalid object in 6.4 instead of undefined, which was returned in the
43
+ previous releases.
44
+ See `Issue #1656 <https://github.com/oracle/node-oracledb/issues/1656 >`__.
45
+
41
46
node-oracledb `v6.4.0 <https://github.com/oracle/node-oracledb/compare/v6.3.0...v6.4.0 >`__ (11 Mar 2024)
42
47
--------------------------------------------------------------------------------------------------------
43
48
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ class AqQueue {
181
181
async deqOne ( ) {
182
182
errors . assertArgCount ( arguments , 0 , 0 ) ;
183
183
const msgImpls = await this . _impl . deq ( 1 ) ;
184
- if ( msgImpls )
184
+ if ( msgImpls . length > 0 )
185
185
return this . _makeMessage ( msgImpls [ 0 ] ) ;
186
186
}
187
187
Original file line number Diff line number Diff line change @@ -357,6 +357,10 @@ static bool njsAqQueue_deqAsync(njsBaton* baton)
357
357
if (baton -> numMsgProps == 1 ) {
358
358
if (dpiQueue_deqOne (queue -> handle , & baton -> msgProps [0 ]) < 0 )
359
359
return njsBaton_setErrorDPI (baton );
360
+
361
+ // Handle the case when message queue is empty
362
+ if (baton -> msgProps [0 ] == NULL )
363
+ baton -> numMsgProps = 0 ;
360
364
} else {
361
365
// deqMany case
362
366
if (dpiQueue_deqMany (queue -> handle , & baton -> numMsgProps ,
Original file line number Diff line number Diff line change @@ -190,4 +190,18 @@ describe('217. aq1.js', function() {
190
190
}
191
191
} ) ; // 217.4
192
192
193
+ it ( '217.5 deqOne on empty queue' , async ( ) => {
194
+ const queue2 = await conn . getQueue ( rawQueueName ) ;
195
+ queue2 . deqOptions . wait = oracledb . AQ_DEQ_NO_WAIT ;
196
+ const message = await queue2 . deqOne ( ) ;
197
+ assert . strictEqual ( message , undefined ) ;
198
+ } ) ;
199
+
200
+ it ( '217.6 deqMany on empty queue' , async ( ) => {
201
+ const queue2 = await conn . getQueue ( rawQueueName ) ;
202
+ queue2 . deqOptions . wait = oracledb . AQ_DEQ_NO_WAIT ;
203
+ const messages = await queue2 . deqMany ( 1 ) ;
204
+ assert . deepStrictEqual ( messages , [ ] ) ;
205
+ } ) ;
206
+
193
207
} ) ;
Original file line number Diff line number Diff line change @@ -4634,6 +4634,8 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
4634
4634
217.2 examples/aqoptions.js
4635
4635
217.3 examples/aqmulti.js
4636
4636
217.4 one message in enqMany/deqMany
4637
+ 217.5 deqOne on empty queue
4638
+ 217.6 deqMany on empty queue
4637
4639
4638
4640
218. aq2.js
4639
4641
218.1 examples/aqobject.js
You can’t perform that action at this time.
0 commit comments