@@ -118,33 +118,6 @@ function _initializeThinDriver() {
118118 require ( './thin' ) ;
119119}
120120
121- //---------------------------------------------------------------------------
122- // _isPrivilege()
123- //
124- // Returns a boolean indicating if the supplied value is a valid privilege.
125- //---------------------------------------------------------------------------
126- function _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-
137- return (
138- value === constants . SYSASM ||
139- value === constants . SYSBACKUP ||
140- value === constants . SYSDBA ||
141- value === constants . SYSDG ||
142- value === constants . SYSKM ||
143- value === constants . SYSOPER ||
144- value === constants . SYSRAC
145- ) ;
146- }
147-
148121//-----------------------------------------------------------------------------
149122// _verifyOptions()
150123//
@@ -331,6 +304,13 @@ async function _verifyOptions(options, inCreatePool) {
331304 outOptions . connectionIdPrefix = options . connectionIdPrefix ;
332305 }
333306
307+ // privilege must be one of a set of named constants
308+ if ( options . privilege !== undefined ) {
309+ errors . assertParamPropValue ( nodbUtil . isPrivilege ( options . privilege ) , 1 ,
310+ "privilege" ) ;
311+ outOptions . privilege = options . privilege ;
312+ }
313+
334314 // check pool specific options
335315 if ( inCreatePool ) {
336316
@@ -444,13 +424,6 @@ async function _verifyOptions(options, inCreatePool) {
444424 outOptions . newPassword = options . newPassword ;
445425 }
446426
447- // privilege must be one of a set of named constants
448- if ( options . privilege !== undefined ) {
449- errors . assertParamPropValue ( _isPrivilege ( options . privilege ) , 1 ,
450- "privilege" ) ;
451- outOptions . privilege = options . privilege ;
452- }
453-
454427 // shardingKey must be an array of values
455428 if ( options . shardingKey !== undefined ) {
456429 const value = options . shardingKey ;
0 commit comments