File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed
Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ Thin Mode Changes
7575Thick Mode Changes
7676+++++++++++++++++++
7777
78+ #) Fixed an issue with privileges that prevented the startup() function from
79+ bringing up the database.
80+
7881#) Tightened code to avoid possible unexpected runtime errors during token
7982 callback.
8083
Original file line number Diff line number Diff line change @@ -124,14 +124,23 @@ function _initializeThinDriver() {
124124// Returns a boolean indicating if the supplied value is a valid privilege.
125125//---------------------------------------------------------------------------
126126function _isPrivilege ( value ) {
127+ // Privileges are mutually exclusive and cannot be specified together
128+ // except SYSPRELIM, which cannot be specified alone, it is specified in a
129+ // combo with SYSOPER or SYSDBA. SYSPRELIM is used only for
130+ // startup/shutdown
131+
132+ // If SYSPRELIM specified, clear the bit
133+ if ( value & constants . SYSPRELIM ) {
134+ value = value ^ constants . SYSPRELIM ;
135+ }
136+
127137 return (
128138 value === constants . SYSASM ||
129139 value === constants . SYSBACKUP ||
130140 value === constants . SYSDBA ||
131141 value === constants . SYSDG ||
132142 value === constants . SYSKM ||
133143 value === constants . SYSOPER ||
134- value === constants . SYSPRELIM ||
135144 value === constants . SYSRAC
136145 ) ;
137146}
Original file line number Diff line number Diff line change @@ -362,6 +362,16 @@ describe('1. connection.js', function() {
362362 await pool . close ( 0 ) ;
363363 } ) ;
364364
365+ it ( '1.7.6 negative test case SYSPRELIM & SYSASM' , async function ( ) {
366+ const credential = { ...dbConfig ,
367+ privilege : oracledb . SYSASM | oracledb . SYSPRELIM
368+ } ;
369+ await assert . rejects (
370+ async ( ) => await oracledb . getConnection ( credential ) ,
371+ / O R A - 0 1 0 3 1 : /
372+ ) ;
373+ } ) ;
374+
365375 } ) ; // 1.7
366376
367377 describe ( '1.8 Ping method' , function ( ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ Overview of node-oracledb functional tests
2424 1.7.3 Negative value - random constants
2525 1.7.4 Negative value - NaN
2626 1.7.5 gets ignored when acquiring a connection from Pool
27+ 1.7.6 negative test case SYSPRELIM & SYSASM
2728 1.8 Ping method
2829 1.8.1 ping() checks the connection is usable
2930 1.8.2 closed connection
You can’t perform that action at this time.
0 commit comments