File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed
Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ messages.set(ERR_UNSUPPORTED_VERIFIER_TYPE, // NJS-116
355355messages . set ( ERR_INVALID_PRIVATE_KEY , // NJS-117
356356 'invalid private key. Headers and footers are not allowed' ) ;
357357messages . set ( ERR_THIN_CONNECTION_ALREADY_CREATED , // NJS-118
358- 'node-oracledb Thick mode cannot be used because a Thin mode connection has already been created' ) ;
358+ 'node-oracledb Thick mode cannot be enabled because a Thin mode connection has already been created' ) ;
359359messages . set ( ERR_UNSUPPORTED_CONVERSION , // NJS-119
360360 'conversion from type %s to type %s is not supported' ) ;
361361messages . set ( ERR_FETCH_TYPE_HANDLER_RETURN_VALUE , // NJS-120
Original file line number Diff line number Diff line change @@ -373,10 +373,10 @@ async function _verifyOptions(options, inCreatePool) {
373373 outOptions . queueTimeout = options . queueTimeout ;
374374 }
375375
376- // queueMax must be an integer >= 0
376+ // queueMax must be an integer >= -1
377377 if ( options . queueMax !== undefined ) {
378378 errors . assertParamPropValue ( Number . isInteger ( options . queueMax ) &&
379- options . queueMax >= 0 , 1 , "queueMax" ) ;
379+ options . queueMax >= - 1 , 1 , "queueMax" ) ;
380380 outOptions . queueMax = options . queueMax ;
381381 }
382382
Original file line number Diff line number Diff line change @@ -502,6 +502,45 @@ describe('2. pool.js', function() {
502502 await pool . close ( 0 ) ;
503503 } ) ;
504504
505+ it ( '2.8.6 queueMax range check, queueMax -1' , async function ( ) {
506+ const config = { ...dbConfig ,
507+ poolMin : 1 ,
508+ poolMax : 1 ,
509+ poolIncrement : 0 ,
510+ queueMax : - 1
511+ } ;
512+ const pool = await oracledb . createPool ( config ) ;
513+ const conn = await pool . getConnection ( ) ;
514+ await conn . close ( ) ;
515+ await pool . close ( 0 ) ;
516+ } ) ;
517+
518+ it ( '2.8.7 queueMax range check, queueMax -2 out of range' , async function ( ) {
519+ const config = { ...dbConfig ,
520+ poolMin : 1 ,
521+ poolMax : 1 ,
522+ poolIncrement : 0 ,
523+ queueMax : - 2
524+ } ;
525+ await assert . rejects (
526+ async ( ) => await oracledb . createPool ( config ) ,
527+ / N J S - 0 0 7 : /
528+ ) ;
529+ } ) ;
530+
531+ it ( '2.8.8 queueMax range check, queueMax -0.5 not an integer' , async function ( ) {
532+ const config = { ...dbConfig ,
533+ poolMin : 1 ,
534+ poolMax : 1 ,
535+ poolIncrement : 0 ,
536+ queueMax : - 1.5
537+ } ;
538+ await assert . rejects (
539+ async ( ) => await oracledb . createPool ( config ) ,
540+ / N J S - 0 0 7 : /
541+ ) ;
542+ } ) ;
543+
505544 } ) ;
506545
507546 describe ( '2.9 _enableStats & _logStats functionality' , function ( ) {
You can’t perform that action at this time.
0 commit comments