Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8a5855b

Browse files
committedNov 15, 2024
Add tests and documentation for the final release
1 parent 2c18432 commit 8a5855b

27 files changed

+530
-139
lines changed
 

‎doc/src/api_manual/connection.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,12 @@ Connection Methods
13501350
If all values in all records for a particular bind variable are null, the type of that bind is ``oracledb.STRING`` with a maximum size of 1.
13511351

13521352
The maximum sizes of strings and buffers are determined by scanning all records unless a :ref:`bindDefs <executemanyoptbinddefs>` property is used. This property explicitly specifies the characteristics of each bind variable.
1353-
* - options
1353+
* - ``numIterations``
1354+
- Number
1355+
- .. _executemanynumiterations:
1356+
1357+
If there are no bind values, or values have previously been bound, then you can set the ``numIterations`` parameter to an integer value that specifies the number of iterations. See :ref:`plsqlexecutemany` for an example of using this parameter.
1358+
* - ``options``
13541359
- Object
13551360
- .. _executemanyoptions:
13561361

‎doc/src/api_manual/oracledb.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,10 +3292,10 @@ Oracledb Methods
32923292
32933293
promise = getNetworkServiceNames(String configDir);
32943294
3295-
Returns a list of network service names that is defined in the
3296-
:ref:`tnsnames.ora <tnsadmin>` file which is inside the directory that
3297-
is specified in the ``configDir`` property or the ``TNS_ADMIN``
3298-
environment variable if ``configDir`` is not specified. If a
3295+
Returns a list of TNS Aliases, also known as Network Service Names,
3296+
defined in the :ref:`tnsnames.ora <tnsadmin>` file which is inside the
3297+
directory that is specified in the ``configDir`` property or the
3298+
``TNS_ADMIN`` environment variable if ``configDir`` is not specified. If a
32993299
``tnsnames.ora`` file does not exist, then an exception is raised.
33003300

33013301
The parameters of the ``oracledb.getNetworkServiceNames()`` method are:

‎doc/src/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
# from the other)
4747
#
4848
# The short X.Y version.
49-
version = '6.6'
50-
release = '6.6.0'
49+
version = '6.7'
50+
release = '6.7.0'
5151

5252
# There are two options for replacing |today|: either, you set today to some
5353
# non-false value, then it is used:

‎doc/src/release_notes.rst

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,46 @@
55
node-oracledb Release Notes
66
===========================
77

8-
For deprecated and desupported features, see :ref:`Deprecations and desupported features <deprecations>`.
8+
For deprecated and desupported features, see
9+
:ref:`Deprecations and desupported features <deprecations>`.
910

1011
node-oracledb `v6.7.0 <https://github.com/oracle/node-oracledb/compare/v6.6.0...v6.7.0>`__ (TBD)
1112
---------------------------------------------------------------------------------------------------------
1213

1314
Common Changes
1415
++++++++++++++
1516

16-
#) Added tracing functionality for OpenTelemetry support.
17+
#) Added :ref:`tracing functionality <tracehandlerinterface>` for
18+
OpenTelemetry support.
1719

1820
#) Changed default values of ``transportConnectTimeout`` and
1921
``retryDelay`` properties to *20* seconds and *1* second respectively in
2022
:meth:`oracledb.getConnection()` and :meth:`oracledb.createPool()` for
2123
consistency with other Oracle Database drivers.
2224

2325
#) Added method :meth:`oracledb.getNetworkServiceNames()` to support fetching
24-
the list of network service names from the ``tnsnames.ora`` file.
26+
the list of TNS Aliases from the ``tnsnames.ora`` file.
2527

26-
#) Improvements to Centralized Configuration Providers support:
28+
#) Improvements to Centralized Configuration Providers support:
2729

28-
- Added support to connect to Oracle Database via the centralized
29-
configuration providers using wallets stored in Azure Key Vault and
30-
OCI Vault.
30+
- Added support to connect to Oracle Database via the centralized
31+
configuration providers using wallets stored in Azure Key Vault and
32+
OCI Vault.
3133

32-
- Added ability to cache the configuration information retrieved from
33-
:ref:`Azure App Configuration <conninfocacheazure>` and
34-
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
35-
providers.
34+
- Added ability to cache the configuration information retrieved from
35+
:ref:`Azure App Configuration <conninfocacheazure>` and
36+
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
37+
providers.
3638

37-
- Ensure that the password stored in OCI vault and retrieved in
38-
base64-encoded format is decoded correctly.
39+
- Ensure that the password stored in OCI vault and retrieved in
40+
base64-encoded format is decoded correctly.
3941

40-
- Added internal code changes to validate the updated OCI centralized
41-
configuration provider URL syntax.
42+
- Added internal code changes to validate the updated OCI centralized
43+
configuration provider URL syntax.
4244

43-
- Changed the password type parameter values from `vault-oci` and
44-
`vault-azure` to `ocivault` and `azurevault` respectively for consistency
45-
with other Oracle Database drivers.
45+
- Changed the password type parameter values from `vault-oci` and
46+
`vault-azure` to `ocivault` and `azurevault` respectively for consistency
47+
with other Oracle Database drivers.
4648

4749
#) Remove the 'Critical Dependency' warning from webpack builds.
4850
See `Issue #1678 <https://github.com/oracle/node-oracledb/issues/1678>`__.

‎doc/src/user_guide/batch_statement.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ Output is::
189189
[ [ 'AAAmI9AAMAAAAnVAAB' ] ],
190190
[ [ 'AAAmI9AAMAAAAnVAAC' ] ] ]
191191

192+
.. _plsqlexecutemany:
193+
192194
Calling PL/SQL with ``executeMany()``
193195
=====================================
194196

‎doc/src/user_guide/migrate.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,38 @@
44
Upgrading to the Latest node-oracledb Releases
55
**********************************************
66

7+
.. _upgradev66v67:
8+
9+
Upgrading from node-oracledb 6.6 to 6.7
10+
=======================================
11+
12+
- Review the :ref:`releasenotes` and take advantage of new features.
13+
14+
- Using the new :meth:`oracledb.getNetworkServiceNames()` method, you can
15+
fetch the list of TNS Aliases from the ``tnsnames.ora`` file.
16+
17+
- With :ref:`Centralized Configuration Providers <configurationprovider>`, you
18+
can now:
19+
20+
- Connect to Oracle Database using wallets stored in Azure Key Vault and OCI
21+
vault.
22+
23+
- Cache the configuration information retrieved from
24+
:ref:`Azure App Configuration <conninfocacheazure>` and
25+
:ref:`OCI Object Storage <conninfocacheoci>` centralized configuration
26+
providers.
27+
28+
- In node-oracledb Thin mode, you can use the attributes
29+
:attr:`oracledb.driverName`, :attr:`oracledb.machine`,
30+
:attr:`oracledb.osUser`, :attr:`oracledb.program`, and
31+
:attr:`oracledb.terminal` to set information about the driver name, machine
32+
name, operating system user, program name, and terminal name respectively.
33+
34+
- In node-oracledb Thick mode, the new ``regId`` property of the
35+
:ref:`message object parameter <messageparam>` in the CQN subscription
36+
:ref:`callback <consubscribeoptcallback>` function returns a unique
37+
identifier during registration.
38+
739
.. _upgradev65v66:
840

941
Upgrading from node-oracledb 6.5 to 6.6

‎doc/src/user_guide/tracing.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,23 @@ node-oracledb.
159159

160160
Node-oracledb applications that call PL/SQL can step through that PL/SQL code
161161
using JDWP in a debugger. This allows Node.js and PL/SQL code to be debugged
162-
in the same debugger environment. You can enable PL/SQL debugging in the
163-
node-oracledb modes as follows:
162+
in the same debugger environment. You can enable PL/SQL debugging in
163+
node-oracledb as follows:
164164

165-
- If you are using node-oracledb Thick mode, set the ``ORA_DEBUG_JDWP``
165+
- In node-oracledb Thin or Thick modes, set the ``ORA_DEBUG_JDWP``
166166
environment variable to `host=hostname;port=portnum` indicating where the
167167
PL/SQL debugger is running. Then run the application.
168168

169-
- In node-oracledb Thin mode, you can additionally set the connection
169+
- In node-oracledb Thin mode, you can alternatively set the connection
170170
parameter ``debugJdwp`` during connection. This variable defaults to the
171171
value of the ``ORA_DEBUG_JDWP`` environment variable.
172172

173-
See `DBMS_DEBUG_JDWP <https://docs.oracle.com/en/database/oracle/oracle-
174-
database/19/arpls/DBMS_DEBUG_JDWP.html>`_ and `Debugging PL/SQL from ASP.NET
175-
and Visual Studio <http://cshay.blogspot.com/2006/10/debugging-plsql-from-
176-
aspnet-and-visual.html>`_.
173+
See the documentation on `DBMS_DEBUG_JDWP <https://www.oracle.com/pls/topic/
174+
lookup?ctx=dblatest&id=GUID-AFF566A0-9E90-4218-B5C6-A74C3BF1CE14>`_, the video
175+
`PL/SQL debugging with Visual Studio and Visual Studio Code <https://www.
176+
youtube.com/watch?v=wk-3hLe30kk>`_, and the blog post `Debugging PL/SQL with
177+
Visual Studio Code (and more) <https://medium.com/oracledevs/debugging-pl-sql-
178+
with-visual-studio-code-and-more-45631f3952cf>`_.
177179

178180
.. _tracingsql:
179181

‎test/aq9.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,12 @@ describe('301. aq9.js', function() {
4545
const ORDER_TYP = `${AQ_USER}.ORDER_TYP`;
4646

4747
before(async function() {
48-
const userConfig = {
49-
user: dbConfig.user,
50-
password: dbConfig.password,
51-
connectString: dbConfig.connectString
52-
};
53-
const initConn = await oracledb.getConnection(userConfig);
48+
const initConn = await oracledb.getConnection(dbConfig);
5449
const dbVersion = initConn.oracleServerVersion;
5550
await initConn.close();
5651

57-
if (!dbConfig.test.DBA_PRIVILEGE || oracledb.thin || dbVersion < 1900000000) {
52+
if (!dbConfig.test.DBA_PRIVILEGE || oracledb.thin || dbVersion < 1900000000
53+
|| testsUtil.getClientVersion() < 2306000000) {
5854
isRunnable = false;
5955
}
6056

‎test/columnMetadata.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -241,7 +241,7 @@ describe('9. columnMetadata.js', function() {
241241
await connection.execute(sqlDrop);
242242
});
243243

244-
it('9.10 works with a large number of columns', async function() {
244+
it('9.3.1 works with a large number of columns', async function() {
245245
const column_size = 300;
246246
columns_string = genColumns(column_size, " NUMBER");
247247

@@ -269,7 +269,7 @@ describe('9. columnMetadata.js', function() {
269269
await connection.execute(sqlDrop);
270270
});
271271

272-
it('9.11 works with re-executes with multiple packet response', async function() {
272+
it('9.3.2 works with re-executes with multiple packet response', async function() {
273273
const column_size = 50;
274274
const numRows = 5;
275275
oracledb.fetchAsString = [oracledb.CLOB];

‎test/connection.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -762,7 +762,14 @@ describe('1. connection.js', function() {
762762
}
763763

764764
res = await conn2.execute(sqlDriverName);
765-
assert.deepStrictEqual(res.rows[0][0], 'mydriver1');
765+
/*
766+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
767+
can be set only upto 8 characters.
768+
*/
769+
let serverVersion = conn2.oracleServerVersion;
770+
if (serverVersion < 1202000000)
771+
assert.deepStrictEqual(res.rows[0][0], 'mydriver');
772+
else assert.deepStrictEqual(res.rows[0][0], 'mydriver1');
766773

767774
// Generate random values for the third connection
768775
const randomPgm3 = random.getRandomLengthString(16);
@@ -794,7 +801,14 @@ describe('1. connection.js', function() {
794801
}
795802

796803
res = await conn3.execute(sqlDriverName);
797-
assert.deepStrictEqual(res.rows[0][0], 'mydriver3');
804+
/*
805+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
806+
can be set only upto 8 characters.
807+
*/
808+
serverVersion = conn2.oracleServerVersion;
809+
if (serverVersion < 1202000000)
810+
assert.deepStrictEqual(res.rows[0][0], 'mydriver');
811+
else assert.deepStrictEqual(res.rows[0][0], 'mydriver3');
798812

799813
// Cleanup
800814
await conn1.close();
@@ -817,7 +831,9 @@ describe('1. connection.js', function() {
817831
assert.strictEqual(res.rows[0][0], os.hostname());
818832
assert.strictEqual(res.rows[0][1], os.userInfo().username);
819833
assert.strictEqual(res.rows[0][2], 'unknown');
820-
assert.strictEqual(res.rows[0][3], process.argv0);
834+
// Whitespaces, ( and ) are replaced by ? for the program name
835+
// in V$SESSION
836+
assert.strictEqual(res.rows[0][3], process.argv0.replace(/[\s()]/g, '?'));
821837

822838
if (dbConfig.test.drcp) {
823839
const bindParams = {
@@ -828,11 +844,20 @@ describe('1. connection.js', function() {
828844
res = await conn.execute(sqlDRCPSessionDetails, bindParams);
829845
assert.deepStrictEqual(res.rows[0][0], os.hostname());
830846
assert.deepStrictEqual(res.rows[0][1], 'unknown');
831-
assert.deepStrictEqual(res.rows[0][2], process.argv0);
847+
// Whitespaces, ( and ) are replaced by ? for the program name
848+
// in V$SESSION
849+
assert.deepStrictEqual(res.rows[0][2], process.argv0.replace(/[\s()]/g, '?'));
832850
}
833851

834852
res = await conn.execute(sqlDriverName);
835-
assert.strictEqual(res.rows[0][0], "node-oracledb : " + oracledb.versionString + " thn");
853+
/*
854+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
855+
can be set only upto 8 characters.
856+
*/
857+
const serverVersion = conn.oracleServerVersion;
858+
if (serverVersion < 1202000000)
859+
assert.strictEqual(res.rows[0][0], "node-ora");
860+
else assert.strictEqual(res.rows[0][0], "node-oracledb : " + oracledb.versionString + " thn");
836861

837862
await conn.close();
838863
}); // 1.18.3

‎test/dataTypeDate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ describe('32. dataTypeDate.js', function() {
186186

187187
// Add an assert statement to check the result
188188
assert.deepStrictEqual(result.rows,
189-
[['01/01/1900 00:00:00']]);
189+
[[new Date('01-01-1900').toLocaleString('fr')]]);
190190
});
191191

192192
it('32.4.3 Negative - Invalid Year -4713', async function() {

‎test/dataTypeUrowid.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2017, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2017, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -143,7 +143,7 @@ describe('113. dataTypeUrowid.js', function() {
143143
const resultVal = rows[i].CONTENT;
144144
assert(resultVal);
145145
}
146-
return fetchRowsFromRS(rs);
146+
return await fetchRowsFromRS(rs);
147147
} else {
148148
await rs.close();
149149
}
@@ -185,7 +185,7 @@ describe('113. dataTypeUrowid.js', function() {
185185
assert(typeof resultVal, "string");
186186
await verifyFetchValues(connection, rsrows[i].NUM, rsrows[i].CONTENT, tableName);
187187
}
188-
return fetchRowsFromRS_fetchas(rs);
188+
return await fetchRowsFromRS_fetchas(rs);
189189
} else {
190190
await rs.close();
191191
}

‎test/dataTypeVector1.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,8 @@ describe('294. dataTypeVector1.js', function() {
12891289
}); // 294.51
12901290

12911291
it('294.52 executeMany with positional args in vector binary flex column', async function() {
1292-
if (!isVectorBinaryRunnable) this.skip();
1292+
const serverVersion = connection.oracleServerVersion;
1293+
if (serverVersion <= 2306000000 || !isVectorBinaryRunnable) this.skip();
12931294

12941295
const rows = [
12951296
[1, [1, 2]],

‎test/dataTypeVector4.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('298. dataTypeVector4.js', function() {
184184
`);
185185

186186
assert.strictEqual(result.rows.length, 1);
187-
assert.deepStrictEqual(result.rows, [[0.10298221668758012]]);
187+
assert.deepStrictEqual(result.rows[0][0].toFixed(6), '0.102982');
188188
}); // 298.4
189189

190190
it('298.5 insert and select Max vector distance function', async function() {
@@ -214,7 +214,7 @@ describe('298. dataTypeVector4.js', function() {
214214
`);
215215

216216
assert.strictEqual(result.rows.length, 1);
217-
assert.deepStrictEqual(result.rows, [[0.28645724726349675]]);
217+
assert.deepStrictEqual(result.rows[0][0].toFixed(6), '0.286457');
218218
}); // 298.5
219219

220220
it('298.6 sum vector distance function vector columns with parallel execution', async function() {
@@ -299,10 +299,12 @@ describe('298. dataTypeVector4.js', function() {
299299

300300
const clientVersion = testsUtil.getClientVersion();
301301
const serverVersion = connection.oracleServerVersion;
302+
const majorServerVersion = Math.floor(serverVersion / 1000000);
303+
const majorClientVersion = Math.floor(clientVersion / 1000000);
302304

303-
// Aggregate functions on vector columns is available from 23.6 onwards
304-
if (serverVersion >= 2306000000 &&
305-
(oracledb.thin || clientVersion >= 2306000000)) {
305+
// Aggregate functions on vector columns are not implemented in Oracle Database 23.6 or earlier versions
306+
if (majorServerVersion > 2306 &&
307+
(oracledb.thin || majorClientVersion > 2306)) {
306308
const result = await connection.execute(`
307309
SELECT /*+ parallel(4) */ sum(VectorCol)
308310
FROM ${tableName}

‎test/dataTypeVector5.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ describe('305. dataTypeVector5.js', function() {
221221
[`SELECT VECTOR_DISTANCE(VectorInt8Col1, VectorInt8Col2, EUCLIDEAN_SQUARED) from ${tableName}`, '10405.0000'],
222222
[`SELECT VECTOR_DISTANCE(VectorInt8Col1, VECTOR('[30, 40]', 2, INT8), EUCLIDEAN_SQUARED) from ${tableName}`, '16441.0000'],
223223
[`SELECT VECTOR_DISTANCE(Vector32Col1, Vector32Col2, EUCLIDEAN_SQUARED) from ${tableName}`, '11.9213'],
224-
[`SELECT VECTOR_DISTANCE(Vector32Col1, VECTOR('[30, 40]', 2, FLOAT32), EUCLIDEAN_SQUARED) from ${tableName}`, '1778.7235'],
224+
[`SELECT VECTOR_DISTANCE(Vector32Col1, VECTOR('[30, 40]', 2, FLOAT32), EUCLIDEAN_SQUARED) from ${tableName}`, '1778.7236'],
225225
[`SELECT VECTOR_DISTANCE(Vector64Col1, Vector64Col2, EUCLIDEAN_SQUARED) from ${tableName}`, '846400010320.4973'],
226226
[`SELECT VECTOR_DISTANCE(Vector64Col1, VECTOR('[30, 40]', 2, FLOAT64), EUCLIDEAN_SQUARED) from ${tableName}`, '864954547855.4663']
227227
]);
@@ -251,7 +251,7 @@ describe('305. dataTypeVector5.js', function() {
251251
(VectorInt8Col1 <=> VectorInt8Col2) from ${tableName}
252252
`);
253253
assert.deepStrictEqual(result.rows[0].toString(),
254-
'143,102.00489807128906,102.00489807128906,0.014268875122070312,-13545,13545,0.014268875122070312');
254+
'143,102.00490184299969,102.00490184299969,0.014268875320571528,-13545,13545,0.014268875320571528');
255255

256256
result = await connection.execute(`
257257
SELECT L1_DISTANCE(Vector32Col1, Vector32Col2),
@@ -263,8 +263,8 @@ describe('305. dataTypeVector5.js', function() {
263263
(Vector32Col1 <=> Vector32Col2) from ${tableName}
264264
`);
265265
assert.deepStrictEqual(result.rows[0],
266-
[4.650000095367432, 3.452723741531372, 3.452723741531372, 0.05660730600357056,
267-
-37.957801818847656, 37.95780015678406, 0.05660730600357056]);
266+
[4.650000095367432, 3.4527236567155133, 3.4527236567155133, 0.056607300796886584,
267+
-37.95780086517334, 37.95780086517334, 0.056607300796886584]);
268268

269269
result = await connection.execute(`
270270
SELECT L1_DISTANCE(Vector64Col1, Vector64Col2),

‎test/dataTypeXML.js

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2022, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -36,7 +36,7 @@ const assert = require('assert');
3636
const dbConfig = require('./dbconfig.js');
3737

3838
describe('181. dataTypeXML.js', function() {
39-
39+
let conn;
4040
const tableName = "nodb_tab_xml";
4141
const testRowID = 1;
4242
const testXMLData =
@@ -58,7 +58,7 @@ describe('181. dataTypeXML.js', function() {
5858
// Storing XMLType column as clob is disallowed in Oracle ADB.
5959
if (dbConfig.test.isCloudService) this.skip();
6060

61-
const connection = await oracledb.getConnection(dbConfig);
61+
const connCreate = await oracledb.getConnection(dbConfig);
6262

6363
let sql =
6464
"BEGIN \n" +
@@ -79,19 +79,19 @@ describe('181. dataTypeXML.js', function() {
7979
" ) XMLTYPE embedLOBXML STORE AS CLOB\n" +
8080
" '); \n" +
8181
"END; ";
82-
await connection.execute(sql);
83-
await connection.commit();
84-
await connection.close();
82+
await connCreate.execute(sql);
83+
await connCreate.commit();
84+
await connCreate.close();
8585

86-
const conn = await oracledb.getConnection(dbConfig);
86+
const connInsert = await oracledb.getConnection(dbConfig);
8787

8888
sql = "insert into " + tableName + " ( num, content ) values ( :id, XMLType(:bv) )";
8989
const bindValues = { id: testRowID, bv: testXMLData };
90-
const result = await conn.execute(sql, bindValues);
90+
const result = await connInsert.execute(sql, bindValues);
9191
assert.strictEqual(result.rowsAffected, 1);
9292

93-
await conn.commit();
94-
await conn.close();
93+
await connInsert.commit();
94+
await connInsert.close();
9595

9696
}); // before
9797

@@ -107,8 +107,15 @@ describe('181. dataTypeXML.js', function() {
107107
await connection.close();
108108
}); // after
109109

110+
beforeEach('create conn', async () => {
111+
conn = await oracledb.getConnection(dbConfig);
112+
});
113+
114+
afterEach('close conn', async () => {
115+
await conn.close();
116+
});
117+
110118
it('181.1 basic case, insert XML data and query back', async () => {
111-
const conn = await oracledb.getConnection(dbConfig);
112119
const sql = "select content from " + tableName + " where num = :id";
113120
const bindVar = { id: testRowID };
114121
const options = { outFormat: oracledb.OUT_FORMAT_OBJECT };
@@ -120,13 +127,9 @@ describe('181. dataTypeXML.js', function() {
120127
assert.strictEqual(result.metaData[0].dbType, oracledb.DB_TYPE_XMLTYPE);
121128
assert.strictEqual(result.metaData[0].fetchType, oracledb.DB_TYPE_XMLTYPE);
122129
}
123-
124-
await conn.close();
125130
}); // 181.1
126131

127132
it('181.2 query XML data as CLOB', async () => {
128-
const conn = await oracledb.getConnection(dbConfig);
129-
130133
const sql = "select xmltype.getclobval(content) as mycontent from " + tableName + " where num = :id";
131134
const bindVar = { id: testRowID };
132135
const options = {
@@ -135,12 +138,9 @@ describe('181. dataTypeXML.js', function() {
135138
};
136139
const result = await conn.execute(sql, bindVar, options);
137140
assert.strictEqual(result.rows[0].MYCONTENT, testXMLData);
138-
139-
await conn.close();
140141
}); // 181.2
141142

142143
it('181.3 another query as CLOB syntax', async function() {
143-
const conn = await oracledb.getConnection(dbConfig);
144144
if (conn.oracleServerVersion < 1200000000) {
145145
await conn.close();
146146
this.skip();
@@ -155,13 +155,11 @@ describe('181. dataTypeXML.js', function() {
155155
};
156156
const result = await conn.execute(sql, bindVar, options);
157157
assert.strictEqual(result.rows[0].MYCONTENT, testXMLData);
158-
await conn.close();
159158
}); // 181.3
160159

161160
it('181.4 Negative - try to insert Null', async () => {
162161
const ID = 20;
163162
const XML = '';
164-
const conn = await oracledb.getConnection(dbConfig);
165163

166164
const sql = "insert into " + tableName + " ( num, content ) values ( :id, XMLType(:bv) )";
167165
const bindValues = { id: ID, bv: XML };
@@ -181,17 +179,19 @@ describe('181. dataTypeXML.js', function() {
181179
}
182180

183181
await conn.commit();
184-
await conn.close();
185182
}); // 181.4
186183

187-
it('181.5 inserts data that is larger than 4K', async () => {
184+
it('181.5 inserts data that is larger than 4K', async function() {
185+
186+
// Insert of LONG data > 4K is not allowed in Oracle Database 12.1
187+
// It throws an ORA-01461 error
188+
if (conn.oracleServerVersion < 1202000000) this.skip();
189+
188190
const ID = 50;
189191
const str = 'a'.repeat(31 * 1024);
190192
const head = '<data>', tail = '</data>\n';
191193
const xml = head.concat(str).concat(tail);
192194

193-
const conn = await oracledb.getConnection(dbConfig);
194-
195195
let sql = "insert into " + tableName + " ( num, content ) values ( :id, XMLType(:bv) )";
196196
const bindValues = { id: ID, bv: xml };
197197
let result = await conn.execute(sql, bindValues);
@@ -211,7 +211,6 @@ describe('181. dataTypeXML.js', function() {
211211
assert.strictEqual(result.rows[0].OBJ, xml);
212212
}
213213
await conn.commit();
214-
await conn.close();
215214
}); // 181.5
216215

217216
it('181.6 Insert and Verify Embedded LOB locator inside XML', async () => {
@@ -222,7 +221,6 @@ describe('181. dataTypeXML.js', function() {
222221
const xml = head.concat(smallstr).concat(tail);
223222
const largexml = head.concat(largestr).concat(tail);
224223

225-
const conn = await oracledb.getConnection(dbConfig);
226224
const lob = await conn.createLob(oracledb.CLOB);
227225
await lob.write(largexml);
228226

@@ -250,7 +248,6 @@ describe('181. dataTypeXML.js', function() {
250248
lob.destroy();
251249
});
252250
await conn.commit();
253-
await conn.close();
254251
}); // 181.6
255252

256253
});

‎test/dbObject20.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ describe('290. dbObject20.js', () => {
12731273
let pool, sysDBAConn, sid;
12741274
const TYPE1 = 'NODB_TYP_NODB_MASTER_ID_ARR';
12751275

1276-
before(async () => {
1276+
before(async function() {
12771277
if (!dbConfig.test.DBA_PRIVILEGE) this.skip();
12781278

12791279
const dbaConfig = {

‎test/fetchArraySize2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2017, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2017, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -255,7 +255,7 @@ describe("149. fetchArraySize2.js", function() {
255255
{ outFormat: oracledb.OUT_FORMAT_OBJECT }
256256
);
257257
const rowCount = 0;
258-
fetchRowsFromRS(result.outBinds[0], numRowsVal, rowCount);
258+
await fetchRowsFromRS(result.outBinds[0], numRowsVal, rowCount);
259259

260260
await connection.execute(drop_ref);
261261
};
@@ -269,7 +269,7 @@ describe("149. fetchArraySize2.js", function() {
269269
assert.strictEqual(rows[i].ID, rowCount);
270270
assert.strictEqual(rows[i].CONTENT, rowCount.toString());
271271
}
272-
return fetchRowsFromRS(rs, numRowsVal, rowCount);
272+
return await fetchRowsFromRS(rs, numRowsVal, rowCount);
273273
} else {
274274
assert.strictEqual(rowCount, tableSize);
275275
await rs.close();

‎test/inBandNotification.js

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
/* Copyright (c) 2024, Oracle and/or its affiliates. */
2+
3+
/******************************************************************************
4+
*
5+
* This software is dual-licensed to you under the Universal Permissive License
6+
* (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7+
* 2.0 as shown at https://www.apache.org/licenses/LICENSE-2.0. You may choose
8+
* either license.
9+
*
10+
* If you elect to accept the software under the Apache License, Version 2.0,
11+
* the following applies:
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License");
14+
* you may not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* https://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS,
21+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*
25+
* NAME
26+
* 308. inBandNotification.js
27+
* No special setup is required but the test makes use of debugging packages
28+
* that are not intended for normal use.
29+
* dbms_tg_dbg.set_session_drainable, here debug package (dbms_tg_dbg) is used to simulate an inband notification.
30+
*/
31+
32+
'use strict';
33+
34+
const oracledb = require('oracledb');
35+
const assert = require('assert');
36+
const dbConfig = require('./dbconfig.js');
37+
const testsUtil = require('./testsUtil.js');
38+
39+
describe('308. Inband Notification', function() {
40+
let isRunnable = false;
41+
const DBA_config = dbConfig.test.DBA_PRIVILEGE ? {
42+
user: dbConfig.test.DBA_user,
43+
password: dbConfig.test.DBA_password,
44+
connectString: dbConfig.connectString,
45+
privilege: oracledb.SYSDBA
46+
} : null;
47+
48+
let dbaConn;
49+
50+
before(async function() {
51+
isRunnable = await testsUtil.checkPrerequisites(1800000000, 1800000000);
52+
if (!dbConfig.test.DBA_PRIVILEGE || !isRunnable) this.skip();
53+
dbaConn = await oracledb.getConnection(DBA_config);
54+
await dbaConn.execute(`GRANT EXECUTE ON dbms_tg_dbg TO ${dbConfig.user}`);
55+
await dbaConn.execute(`GRANT SELECT ON v_$session TO ${dbConfig.user}`);
56+
});
57+
58+
after(async function() {
59+
if (dbConfig.test.DBA_PRIVILEGE && isRunnable) {
60+
await dbaConn.execute(`REVOKE EXECUTE ON dbms_tg_dbg FROM ${dbConfig.user}`);
61+
await dbaConn.execute(`REVOKE SELECT ON v_$session FROM ${dbConfig.user}`);
62+
await dbaConn.close();
63+
}
64+
});
65+
66+
describe('308.1 Standalone Connection', function() {
67+
let conn;
68+
69+
beforeEach(async function() {
70+
conn = await oracledb.getConnection(dbConfig);
71+
});
72+
73+
afterEach(async function() {
74+
await conn.close();
75+
});
76+
77+
it('308.1.1 test standalone connection is marked unhealthy', async function() {
78+
assert.strictEqual(conn.isHealthy(), true);
79+
80+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
81+
const result = await conn.execute("SELECT user FROM dual");
82+
assert.strictEqual(result.rows[0][0], dbConfig.user.toUpperCase());
83+
84+
assert.strictEqual(conn.isHealthy(), false);
85+
}); // 308.1.1
86+
87+
it('308.1.2 test connection health after executing a long-running query', async function() {
88+
assert.strictEqual(conn.isHealthy(), true);
89+
90+
const majorDBVersion = await testsUtil.getMajorDBVersion();
91+
92+
// Appropriate sleep procedure based on the database version
93+
const sleepProc = (majorDBVersion >= 18) ? 'dbms_session.sleep' : 'dbms_lock.sleep';
94+
95+
await conn.execute(`
96+
BEGIN
97+
${sleepProc}(5);
98+
END;
99+
`);
100+
101+
assert.strictEqual(conn.isHealthy(), true);
102+
103+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
104+
assert.strictEqual(conn.isHealthy(), false);
105+
}); // 308.1.2
106+
107+
it('308.1.3 test connection health after a PL/SQL error', async function() {
108+
assert.strictEqual(conn.isHealthy(), true);
109+
110+
await assert.rejects(
111+
async () => await conn.execute(`
112+
BEGIN
113+
RAISE_APPLICATION_ERROR(-20001, 'Test error');
114+
END;
115+
`),
116+
/ORA-20001/ // Test error
117+
);
118+
119+
assert.strictEqual(conn.isHealthy(), true);
120+
121+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
122+
assert.strictEqual(conn.isHealthy(), false);
123+
}); // 308.1.3
124+
125+
it('308.1.4 test connection health after setting session drainable multiple times', async function() {
126+
assert.strictEqual(conn.isHealthy(), true);
127+
128+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
129+
assert.strictEqual(conn.isHealthy(), false);
130+
131+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
132+
assert.strictEqual(conn.isHealthy(), false);
133+
}); // 308.1.4
134+
135+
it('308.1.5 test connection health after ORA-00001 unique constraint error', async function() {
136+
const tableName = 'emp';
137+
const sql = `CREATE TABLE ${tableName} (
138+
id NUMBER primary key,
139+
VALUE varchar(30)
140+
)`;
141+
await conn.execute(testsUtil.sqlCreateTable(tableName, sql));
142+
143+
await assert.rejects(
144+
async () => await conn.execute(`
145+
BEGIN
146+
INSERT INTO ${tableName} (id, value) VALUES (1, 'test');
147+
INSERT INTO ${tableName} (id, value) VALUES (1, 'test'); -- Will cause ORA-00001
148+
END;
149+
`),
150+
/ORA-00001/
151+
);
152+
153+
assert.strictEqual(conn.isHealthy(), true);
154+
155+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
156+
assert.strictEqual(conn.isHealthy(), false);
157+
}); // 308.1.5
158+
159+
it('308.1.6 test connection health after multiple drainable sessions in quick succession', async function() {
160+
assert.strictEqual(conn.isHealthy(), true);
161+
162+
for (let i = 0; i < 5; i++) {
163+
await conn.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
164+
assert.strictEqual(conn.isHealthy(), false);
165+
}
166+
}); // 308.1.6
167+
});
168+
169+
describe('308.2 Pooled Connection', function() {
170+
let pool;
171+
172+
before(async function() {
173+
pool = await oracledb.createPool({
174+
...dbConfig,
175+
poolMin: 1,
176+
poolMax: 2,
177+
poolIncrement: 1
178+
});
179+
});
180+
181+
after(async function() {
182+
await pool.close(0);
183+
});
184+
185+
it('308.2.1 test pooled connection that is marked unhealthy', async function() {
186+
/* Skip this test for clients before 23.1 due to inconsistent behavior
187+
of OCI_ATTR_SERVER_STATUS on subsequent calls.
188+
*/
189+
if (!oracledb.thin && testsUtil.getClientVersion() < 2301000000)
190+
this.skip();
191+
const conn1 = await pool.getConnection();
192+
assert.strictEqual(conn1.isHealthy(), true);
193+
194+
await conn1.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
195+
const info = await getSidSerial(conn1);
196+
assert.strictEqual(conn1.isHealthy(), false);
197+
await conn1.close();
198+
199+
const conn2 = await pool.getConnection();
200+
assert.strictEqual(conn2.isHealthy(), true);
201+
const newInfo = await getSidSerial(conn2);
202+
assert.notStrictEqual(newInfo, info);
203+
await conn2.close();
204+
}); // 308.2.1
205+
206+
it('308.2.2 test multiple connections in a pool with inband notifications', async function() {
207+
const conn1 = await pool.getConnection();
208+
const conn2 = await pool.getConnection();
209+
210+
assert.strictEqual(conn1.isHealthy(), true);
211+
assert.strictEqual(conn2.isHealthy(), true);
212+
213+
await conn1.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
214+
assert.strictEqual(conn1.isHealthy(), false);
215+
assert.strictEqual(conn2.isHealthy(), true);
216+
217+
await conn1.close();
218+
await conn2.close();
219+
}); // 308.2.2
220+
221+
it('308.2.3 test connection reuse after marking unhealthy', async function() {
222+
const conn1 = await pool.getConnection();
223+
assert.strictEqual(conn1.isHealthy(), true);
224+
225+
await conn1.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
226+
assert.strictEqual(conn1.isHealthy(), false);
227+
await conn1.close();
228+
229+
const conn2 = await pool.getConnection();
230+
assert.strictEqual(conn2.isHealthy(), true);
231+
await conn2.close();
232+
}); // 308.2.3
233+
234+
it('308.2.4 test pool draining with multiple sessions', async function() {
235+
const conn1 = await pool.getConnection();
236+
const conn2 = await pool.getConnection();
237+
238+
assert.strictEqual(conn1.isHealthy(), true);
239+
assert.strictEqual(conn2.isHealthy(), true);
240+
241+
await conn1.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
242+
assert.strictEqual(conn1.isHealthy(), false);
243+
244+
await conn2.execute("BEGIN dbms_tg_dbg.set_session_drainable; END;");
245+
assert.strictEqual(conn2.isHealthy(), false);
246+
247+
await conn1.close();
248+
await conn2.close();
249+
250+
const conn3 = await pool.getConnection();
251+
assert.strictEqual(conn3.isHealthy(), true);
252+
await conn3.close();
253+
}); // 308.2.4
254+
});
255+
256+
async function getSidSerial(conn) {
257+
const result = await conn.execute(
258+
"SELECT sid || ',' || serial# AS info FROM v$session WHERE audsid = SYS_CONTEXT('USERENV', 'SESSIONID')"
259+
);
260+
return result.rows[0][0];
261+
}
262+
});

‎test/jsonDualityViews2.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ describe('273. jsonDualityView2.js', function() {
188188
await connection.execute(testsUtil.sqlDropTable(`student`));
189189
});
190190

191-
it('273.6 Specify DELETE, NODELETE both, BUG number : 34657745', async function() {
191+
it('273.6 Specify DELETE, NODELETE both', async function() {
192192
await connection.execute(testsUtil.sqlCreateTable('student', sqlCreateTableStudent));
193193

194194
// insert data into student table
@@ -198,14 +198,7 @@ describe('273. jsonDualityView2.js', function() {
198198

199199
// commit the transaction
200200
await connection.execute(`COMMIT`);
201-
await assert.rejects(
202-
async () => await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov
203-
AS
204-
Student
205-
{StudentId: stuid @NODELETE, StudentName: name}`),
206-
/ORA-40934:/ //ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV':
207-
//Invalid or conflicting annotations in the WITH clause.
208-
);
201+
209202
await assert.rejects(
210203
async () => await connection.execute(`CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW student_ov
211204
AS

‎test/jsonDualityViews4.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ describe('275. jsonDualityView4.js', function() {
353353
SELECT view_name, view_owner, ROOT_TABLE_NAME
354354
FROM DBA_JSON_DUALITY_VIEWS
355355
ORDER BY view_name`);
356-
assert.strictEqual(result.rows.length, 1);
356+
assert.strictEqual(result.rows[0].length, 3);
357357

358358
// Query 2: select view_owner, view_name, relationship from DBA_JSON_DUALITY_VIEW_TABS
359359
result = await dbaConn.execute(`
@@ -368,9 +368,8 @@ describe('275. jsonDualityView4.js', function() {
368368
SELECT COLUMN_NAME, DATA_TYPE
369369
FROM DBA_JSON_DUALITY_VIEW_TAB_COLS
370370
ORDER BY COLUMN_NAME`);
371-
372-
assert.deepStrictEqual(result.rows, [["CLSID", "NUMBER"], ["CLSID", "NUMBER"], ["NAME", "VARCHAR2"],
373-
["NAME", "VARCHAR2"], ["SCID", "NUMBER"], ["STUID", "NUMBER"], ["STUID", "NUMBER"]]);
371+
assert.deepStrictEqual(result.rows, [["CLSID", "NUMBER"], ["CLSID", "NUMBER"], ["NAME", "VARCHAR2"], ["NAME", "VARCHAR2"], ["SCID", "NUMBER"],
372+
["STUID", "NUMBER"], ["STUID", "NUMBER"]]);
374373
});
375374

376375
describe('275.7 Json Duality view with GraphQL', function() {

‎test/jsonDualityViews5.js

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,12 @@ describe('276. jsonDualityView5.js', function() {
215215
{StudentClassId : scid,
216216
Class : class {ClassId: clsid, Name: name}}}
217217
`),
218-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
219-
conflicting annotations in the WITH clause */
218+
// Server version < v26.1 will return ORA-40934
219+
/ORA-40934|ORA-43411:/
220+
/*
221+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
222+
ORA-43411: Invalid directive 'del' for the table 'STUDENT'
223+
*/
220224
);
221225

222226
await assert.rejects(
@@ -232,8 +236,12 @@ describe('276. jsonDualityView5.js', function() {
232236
{StudentClassId : scid,
233237
Class : class {ClassId: clsid, Name: name}}}
234238
`),
235-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
236-
conflicting annotations in the WITH clause */
239+
// Server version < v26.1 will return ORA-40934
240+
/ORA-40934|ORA-43411:/
241+
/*
242+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
243+
ORA-43411: Invalid directive 'ins' for the table 'STUDENT'
244+
*/
237245
);
238246

239247
await assert.rejects(
@@ -295,8 +303,12 @@ describe('276. jsonDualityView5.js', function() {
295303
{StudentClassId : scid,
296304
Class : class {ClassId: clsid, Name: name}}}
297305
`),
298-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
299-
conflicting annotations in the WITH clause */
306+
// Server version < v26.1 will return ORA-40934
307+
/ORA-40934|ORA-43411:/
308+
/*
309+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
310+
ORA-43411: Invalid directive 'nodelete' for the table 'STUDENT'
311+
*/
300312
);
301313

302314
await assert.rejects(
@@ -328,8 +340,12 @@ describe('276. jsonDualityView5.js', function() {
328340
{StudentClassId : scid,
329341
Class : class {ClassId: clsid, Name: name}}}
330342
`),
331-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
332-
conflicting annotations in the WITH clause */
343+
// Server version < v26.1 will return ORA-40934
344+
/ORA-40934|ORA-43411:/
345+
/*
346+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
347+
ORA-43411: Invalid directive 'insert' for the table 'STUDENT'
348+
*/
333349
);
334350

335351
await connection.execute(`
@@ -424,8 +440,12 @@ describe('276. jsonDualityView5.js', function() {
424440
{StudentClassId : scid,
425441
Class : class {ClassId: clsid, Name: name @NOUPDATE @UPDATE}}}
426442
`),
427-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
428-
conflicting annotations in the WITH clause */
443+
// Server version < v26.1 will return ORA-40934
444+
/ORA-40934|ORA-43411:/
445+
/*
446+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
447+
ORA-43411: Invalid directive 'nodelete' for the table 'STUDENT'
448+
*/
429449
);
430450

431451
await assert.rejects(
@@ -470,8 +490,12 @@ describe('276. jsonDualityView5.js', function() {
470490
{StudentClassId : scid,
471491
Class : class {ClassId: clsid, Name: name}}}
472492
`),
473-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
474-
conflicting annotations in the WITH clause */
493+
// Server version < v26.1 will return ORA-40934
494+
/ORA-40934|ORA-43411:/
495+
/*
496+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
497+
ORA-43411: Invalid directive 'readonly' for the table 'STUDENT'
498+
*/
475499
);
476500

477501
await connection.execute(`
@@ -484,7 +508,7 @@ describe('276. jsonDualityView5.js', function() {
484508
StudentClass :
485509
student_class @insert@update@delete
486510
{StudentClassId : scid,
487-
Class : class {ClassId: clsid, Name: name}}}
511+
Class : class @insert@update {ClassId: clsid, Name: name}}}
488512
`);
489513

490514
await connection.execute(`
@@ -508,8 +532,12 @@ describe('276. jsonDualityView5.js', function() {
508532
{StudentClassId : scid,
509533
Class : class {ClassId: clsid, Name: name}}}
510534
`),
511-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
512-
conflicting annotations in the WITH clause */
535+
// Server version < v26.1 will return ORA-40934
536+
/ORA-40934|ORA-43411:/
537+
/*
538+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
539+
ORA-43411: Invalid directive 'read' for the table 'STUDENT'
540+
*/
513541
);
514542

515543
await assert.rejects(
@@ -541,8 +569,12 @@ describe('276. jsonDualityView5.js', function() {
541569
{StudentClassId : scid,
542570
Class : class {ClassId: clsid, Name: name}}}
543571
`),
544-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
545-
conflicting annotations in the WITH clause */
572+
// Server version < v26.1 will return ORA-40934
573+
/ORA-40934|ORA-43411:/
574+
/*
575+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
576+
ORA-43411: Invalid directive 'etag' for the table 'STUDENT'
577+
*/
546578
);
547579

548580
await assert.rejects(
@@ -558,8 +590,12 @@ describe('276. jsonDualityView5.js', function() {
558590
{StudentClassId : scid,
559591
Class : class {ClassId: clsid, Name: name}}}
560592
`),
561-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
562-
conflicting annotations in the WITH clause */
593+
// Server version < v26.1 will return ORA-40934
594+
/ORA-40934|ORA-43411:/
595+
/*
596+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
597+
ORA-43411: Invalid directive 'checketag' for the table 'STUDENT'
598+
*/
563599
);
564600

565601
await connection.execute(`
@@ -626,8 +662,12 @@ annotation or NOUPDATE annotation specified.*/
626662
{StudentClassId : scid,
627663
Class : class {ClassId: clsid, Name: name}}}
628664
`),
629-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
630-
conflicting annotations in the WITH clause */
665+
// Server version < v26.1 will return ORA-40934
666+
/ORA-40934|ORA-43411:/
667+
/*
668+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
669+
ORA-43411: Invalid directive 'nest' for the table 'STUDENT'
670+
*/
631671
);
632672

633673
await assert.rejects(
@@ -667,7 +707,7 @@ annotation or NOUPDATE annotation specified.*/
667707
Student @insert@update@delete
668708
{
669709
StudentId: stuid,
670-
StudentName : student @nest{NULL:name} ,
710+
StudentName : student @nest{NULL:name},
671711
StudentClass :
672712
student_class @insert@update@delete
673713
{StudentClassId : scid,

‎test/jsonDualityViews6.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,12 @@ describe('277. jsonDualityView6.js', function() {
231231
StudentId:stuid @INSERT
232232
}
233233
}`),
234-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
235-
conflicting annotations in the WITH clause.*/
234+
// Server version < v26.1 will return ORA-40934
235+
/ORA-40934|ORA-43411:/
236+
/*
237+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
238+
ORA-43411: Invalid directive 'insert' for the table 'STUDENT'
239+
*/
236240
);
237241

238242
await assert.rejects(
@@ -250,8 +254,12 @@ describe('277. jsonDualityView6.js', function() {
250254
StudentId:stuid
251255
}
252256
}`),
253-
/ORA-40934:/ /*ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or
254-
conflicting annotations in the WITH clause.*/
257+
// Server version < v26.1 will return ORA-40934
258+
/ORA-40934|ORA-43411:/
259+
/*
260+
ORA-40934: Cannot create JSON Relational Duality View 'STUDENT_OV': Invalid or conflicting annotations for the JSON field.
261+
ORA-43411: Invalid directive 'insert' for the table 'STUDENT'
262+
*/
255263
);
256264
});
257265

‎test/list.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ Overview of node-oracledb functional tests
321321
9.2.1 works for tables whose column names were created case sensitively
322322
9.3 Large number of columns
323323
9.3.1 works with a large number of columns
324+
9.3.2 works with re-executes with multiple packet response
324325
9.4 single character column
325326
9.4.1 works with column names consisting of single characters
326327
9.5 duplicate column alias
@@ -5979,3 +5980,17 @@ oracledb.OUT_FORMAT_OBJECT and resultSet = true
59795980
307.1.3 getConnection behaviour with a custom instance disabling trace
59805981
307.1.4 test getConnection fail behaviour with custom instance enabling trace
59815982
307.1.5 test getConnection fail behaviour with custom instance disabling trace
5983+
5984+
308. Inband Notification
5985+
308.1 Standalone Connection
5986+
308.1.1 test standalone connection is marked unhealthy
5987+
308.1.2 test connection health after executing a long-running query
5988+
308.1.3 test connection health after a PL/SQL error
5989+
308.1.4 test connection health after setting session drainable multiple times
5990+
308.1.5 test connection health after ORA-00001 unique constraint error
5991+
308.1.6 test connection health after multiple drainable sessions in quick succession
5992+
308.2 Pooled Connection
5993+
308.2.1 test pooled connection that is marked unhealthy
5994+
308.2.2 test multiple connections in a pool with inband notifications
5995+
308.2.3 test connection reuse after marking unhealthy
5996+
308.2.4 test pool draining with multiple sessions

‎test/longDMLBind.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('125. longDMLBind.js', function() {
105105
await test2(random.getRandomLengthString(65536), random.getRandomLengthString(size), size);
106106
});
107107

108-
}); // 125.3
108+
}); // 125.2
109109

110110
describe('125.3 RETURNING INTO', function() {
111111

@@ -139,7 +139,7 @@ describe('125. longDMLBind.js', function() {
139139
};
140140
const result = await connection.execute(sql_query, bindVar);
141141
assert(result);
142-
assert.equal(1, result.rowsAffected);
142+
assert.equal(result.rowsAffected, 1);
143143
};
144144

145145
const update = async function(content, maxsize) {
@@ -150,7 +150,7 @@ describe('125. longDMLBind.js', function() {
150150
};
151151
const result = await connection.execute(sql_query, bindVar);
152152
assert(result);
153-
assert.equal(1, result.rowsAffected);
153+
assert.equal(result.rowsAffected, 1);
154154
};
155155

156156
const returning = async function(content) {

‎test/pool.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -1505,7 +1505,14 @@ describe('2. pool.js', function() {
15051505
}
15061506

15071507
res = await conn.execute(sqlDriverName);
1508-
assert.strictEqual(res.rows[0][0], prePoolDriver);
1508+
/*
1509+
In Oracle 12.1 DB, The driver name (CLIENT_DRIVER column in V$SESSION_CONNECT_INFO view)
1510+
can be set only upto 8 characters.
1511+
*/
1512+
const serverVersion = conn.oracleServerVersion;
1513+
if (serverVersion < 1202000000)
1514+
assert.strictEqual(res.rows[0][0], "pre_pool");
1515+
else assert.strictEqual(res.rows[0][0], prePoolDriver);
15091516

15101517
await conn.close();
15111518
await pool.close(0);

‎test/urowidDMLBindAsString2.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2017, 2023, Oracle and/or its affiliates. */
1+
/* Copyright (c) 2017, 2024, Oracle and/or its affiliates. */
22

33
/******************************************************************************
44
*
@@ -341,6 +341,9 @@ describe('115. urowidDMLBindAsString2.js', function() {
341341
} catch (err) {
342342
if (urowidLen > 4000) {
343343
assert.strictEqual(err.message, "ORA-01704: string literal too long");
344+
} else {
345+
// This is a test failure
346+
throw err;
344347
}
345348
}
346349
if (urowidLen <= 4000) {

0 commit comments

Comments
 (0)
Please sign in to comment.