@@ -849,7 +849,14 @@ describe('1. connection.js', function() {
849
849
850
850
// Whitespaces, comma, ( and ) are replaced by ? for the program name
851
851
// in V$SESSION
852
- const sanitizedProgName = process . argv0 . replace ( / [ \s ( ) , ] / g, '?' ) ;
852
+ let sanitizedProgName = process . argv0 . replace ( / [ \s ( ) , ] / g, '?' ) ;
853
+ /*
854
+ In Oracle < 23.0 DB, The program name (program column in v$session view)
855
+ can be set only upto 48 characters.
856
+ */
857
+ const serverVersion = conn . oracleServerVersion ;
858
+ if ( serverVersion < 2300000000 )
859
+ sanitizedProgName = sanitizedProgName . substring ( 0 , 48 ) ;
853
860
854
861
// Fetch values from v$session
855
862
let res = await conn . execute ( sqlSessionDetails ) ;
@@ -875,7 +882,6 @@ describe('1. connection.js', function() {
875
882
In Oracle 12.1.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
876
883
can be set only upto 8 characters.
877
884
*/
878
- const serverVersion = conn . oracleServerVersion ;
879
885
if ( serverVersion < 1201000200 )
880
886
assert . strictEqual ( res . rows [ 0 ] [ 0 ] , "node-ora" ) ;
881
887
else assert . strictEqual ( res . rows [ 0 ] [ 0 ] , "node-oracledb : " + oracledb . versionString + " thn" ) ;
0 commit comments