oracledb 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/Release/oracledb-6.3.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.3.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.3.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.3.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.3.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.3.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.3.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.3.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.3.0-win32-x64.node-buildinfo.txt +1 -0
- package/examples/README.md +26 -8
- package/examples/dbconfig.js +50 -26
- package/examples/example.js +6 -4
- package/lib/connection.js +66 -0
- package/lib/errors.js +18 -0
- package/lib/future.js +53 -0
- package/lib/impl/connection.js +56 -0
- package/lib/impl/pool.js +5 -3
- package/lib/impl/resultset.js +48 -11
- package/lib/oracledb.js +23 -8
- package/lib/pool.js +10 -0
- package/lib/thin/connection.js +46 -2
- package/lib/thin/dbObject.js +45 -1
- package/lib/thin/index.js +1 -1
- package/lib/thin/pool.js +3 -2
- package/lib/thin/protocol/buffer.js +15 -7
- package/lib/thin/protocol/capabilities.js +3 -1
- package/lib/thin/protocol/constants.js +31 -14
- package/lib/thin/protocol/messages/auth.js +6 -2
- package/lib/thin/protocol/messages/base.js +29 -14
- package/lib/thin/protocol/messages/dataType.js +8 -5
- package/lib/thin/protocol/messages/lobOp.js +7 -8
- package/lib/thin/protocol/messages/withData.js +53 -18
- package/lib/thin/protocol/utils.js +1 -1
- package/lib/thin/sqlnet/connStrategy.js +8 -4
- package/lib/thin/sqlnet/constants.js +138 -138
- package/lib/thin/sqlnet/navNodes.js +5 -5
- package/lib/thin/sqlnet/networkSession.js +9 -2
- package/lib/thin/sqlnet/ntTcp.js +7 -7
- package/lib/thin/statement.js +1 -1
- package/lib/thin/util.js +15 -4
- package/lib/types.js +6 -1
- package/lib/util.js +8 -0
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/build/Release/oracledb-6.2.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.2.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.2.0-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.2.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.2.0-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.2.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.2.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.2.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.2.0-win32-x64.node-buildinfo.txt +0 -1
|
@@ -30,7 +30,7 @@ const { Buffer } = require('buffer');
|
|
|
30
30
|
const utils = require("../utils");
|
|
31
31
|
const constants = require("../constants.js");
|
|
32
32
|
const Message = require("./base.js");
|
|
33
|
-
const ThinDbObjectImpl = require("../../dbObject.js");
|
|
33
|
+
const { ThinDbObjectImpl, readXML } = require("../../dbObject.js");
|
|
34
34
|
const ThinLobImpl = require("../../lob.js");
|
|
35
35
|
const errors = require('../../../errors');
|
|
36
36
|
const types = require('../../../types.js');
|
|
@@ -177,19 +177,10 @@ class MessageWithData extends Message {
|
|
|
177
177
|
const dataType = buf.readUInt8();
|
|
178
178
|
buf.skipUB1(); // flags
|
|
179
179
|
const precision = buf.readInt8();
|
|
180
|
-
|
|
181
|
-
if (dataType === constants.TNS_DATA_TYPE_NUMBER ||
|
|
182
|
-
dataType === constants.TNS_DATA_TYPE_INTERVAL_DS ||
|
|
183
|
-
dataType === constants.TNS_DATA_TYPE_TIMESTAMP ||
|
|
184
|
-
dataType === constants.TNS_DATA_TYPE_TIMESTAMP_LTZ ||
|
|
185
|
-
dataType === constants.TNS_DATA_TYPE_TIMESTAMP_TZ) {
|
|
186
|
-
scale = buf.readSB2();
|
|
187
|
-
} else {
|
|
188
|
-
scale = buf.readInt8();
|
|
189
|
-
}
|
|
180
|
+
const scale = buf.readInt8();
|
|
190
181
|
const maxSize = buf.readUB4();
|
|
191
182
|
buf.skipUB4(); // max number of array elements
|
|
192
|
-
buf.
|
|
183
|
+
buf.skipUB8(); // cont flags
|
|
193
184
|
let oid;
|
|
194
185
|
let numBytes = buf.readUB4(); // OID
|
|
195
186
|
if (numBytes > 0) {
|
|
@@ -223,7 +214,7 @@ class MessageWithData extends Message {
|
|
|
223
214
|
typeName = buf.readStr(constants.CSFRM_IMPLICIT);
|
|
224
215
|
}
|
|
225
216
|
buf.skipUB2(); // column position
|
|
226
|
-
buf.
|
|
217
|
+
const udsFlags = buf.readUB4(); // uds flag
|
|
227
218
|
|
|
228
219
|
// build metadata
|
|
229
220
|
const fetchInfo = {
|
|
@@ -231,6 +222,39 @@ class MessageWithData extends Message {
|
|
|
231
222
|
dbType: types.getTypeByOraTypeNum(dataType, csfrm),
|
|
232
223
|
nullable: nullable
|
|
233
224
|
};
|
|
225
|
+
fetchInfo.isJson = Boolean(udsFlags & constants.TNS_UDS_FLAGS_IS_JSON);
|
|
226
|
+
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_23_1) {
|
|
227
|
+
numBytes = buf.readUB4();
|
|
228
|
+
if (numBytes > 0) {
|
|
229
|
+
fetchInfo.domainSchema = buf.readStr(constants.CSFRM_IMPLICIT);
|
|
230
|
+
}
|
|
231
|
+
numBytes = buf.readUB4();
|
|
232
|
+
if (numBytes > 0) {
|
|
233
|
+
fetchInfo.domainName = buf.readStr(constants.CSFRM_IMPLICIT);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_23_1_EXT_3) {
|
|
237
|
+
if (buf.readUB4() > 0) {
|
|
238
|
+
fetchInfo.annotations = {};
|
|
239
|
+
buf.skipUB1();
|
|
240
|
+
const numAnnotations = buf.readUB4();
|
|
241
|
+
buf.skipUB1();
|
|
242
|
+
let key, value;
|
|
243
|
+
for (let i = 0; i < numAnnotations; i++) {
|
|
244
|
+
buf.skipUB4();
|
|
245
|
+
value = "";
|
|
246
|
+
key = buf.readStr(constants.CSFRM_IMPLICIT);
|
|
247
|
+
numBytes = buf.readUB4();
|
|
248
|
+
if (numBytes > 0) {
|
|
249
|
+
value = buf.readStr(constants.CSFRM_IMPLICIT);
|
|
250
|
+
}
|
|
251
|
+
fetchInfo.annotations[key] = value;
|
|
252
|
+
buf.skipUB4(); // flags
|
|
253
|
+
}
|
|
254
|
+
buf.skipUB4(); // flags
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
234
258
|
switch (fetchInfo.dbType) {
|
|
235
259
|
case types.DB_TYPE_VARCHAR:
|
|
236
260
|
case types.DB_TYPE_NVARCHAR:
|
|
@@ -253,6 +277,9 @@ class MessageWithData extends Message {
|
|
|
253
277
|
if (fetchInfo.dbTypeClass.partial) {
|
|
254
278
|
this.connection._partialDbObjectTypes.push(fetchInfo.dbTypeClass);
|
|
255
279
|
}
|
|
280
|
+
if (fetchInfo.dbTypeClass.isXmlType) {
|
|
281
|
+
fetchInfo.dbType = types.DB_TYPE_XMLTYPE;
|
|
282
|
+
}
|
|
256
283
|
break;
|
|
257
284
|
default:
|
|
258
285
|
break;
|
|
@@ -459,9 +486,14 @@ class MessageWithData extends Message {
|
|
|
459
486
|
if (obj.packedData) {
|
|
460
487
|
const objType = (variable.fetchInfo) ? variable.fetchInfo.dbTypeClass :
|
|
461
488
|
variable.typeClass;
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
489
|
+
|
|
490
|
+
if (variable.type === types.DB_TYPE_XMLTYPE) {
|
|
491
|
+
colValue = readXML(this.connection, obj.packedData);
|
|
492
|
+
} else {
|
|
493
|
+
colValue = new ThinDbObjectImpl(objType, obj.packedData);
|
|
494
|
+
colValue.toid = obj.toid;
|
|
495
|
+
colValue.oid = obj.oid;
|
|
496
|
+
}
|
|
465
497
|
}
|
|
466
498
|
} else {
|
|
467
499
|
errors.throwErr(errors.ERR_UNSUPPORTED_DATA_TYPE, dbType.num,
|
|
@@ -472,7 +504,10 @@ class MessageWithData extends Message {
|
|
|
472
504
|
const actualNumBytes = buf.readSB4();
|
|
473
505
|
if (actualNumBytes < 0 && oraTypeNum === constants.TNS_DATA_TYPE_BOOLEAN) {
|
|
474
506
|
colValue = null;
|
|
475
|
-
|
|
507
|
+
|
|
508
|
+
// For objects, maxsize validation is skipped
|
|
509
|
+
} else if (actualNumBytes !== 0 && colValue !== null &&
|
|
510
|
+
oraTypeNum !== constants.TNS_DATA_TYPE_INT_NAMED) {
|
|
476
511
|
this.saveDeferredErr(errors.ERR_INSUFFICIENT_BUFFER_FOR_BINDS);
|
|
477
512
|
}
|
|
478
513
|
} else if (oraTypeNum === constants.TNS_DATA_TYPE_LONG || oraTypeNum === constants.TNS_DATA_TYPE_LONG_RAW || variable.maxSize > buf.caps.maxStringSize) {
|
|
@@ -694,7 +729,7 @@ class MessageWithData extends Message {
|
|
|
694
729
|
this.writeBindParamsColumn(buf, variable, variable.values[i]);
|
|
695
730
|
}
|
|
696
731
|
} else {
|
|
697
|
-
if (variable.maxSize > buf.caps.maxStringSize) {
|
|
732
|
+
if ((!this.statement.isPlSql) && variable.maxSize > buf.caps.maxStringSize) {
|
|
698
733
|
foundLong = true;
|
|
699
734
|
} else {
|
|
700
735
|
this.writeBindParamsColumn(buf, variable,
|
|
@@ -64,7 +64,7 @@ function setObfuscatedValue(value) {
|
|
|
64
64
|
arr.push(buf[i] ^ bytes[i]);
|
|
65
65
|
}
|
|
66
66
|
bytes.fill(0);
|
|
67
|
-
return {obfuscatedValue
|
|
67
|
+
return {obfuscatedValue: buf, value: arr};
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// returns the Deobfuscated value, after removing the obfuscation
|
|
@@ -53,16 +53,20 @@ class ConnectDescription {
|
|
|
53
53
|
*/
|
|
54
54
|
class ConnStrategy {
|
|
55
55
|
constructor() {
|
|
56
|
-
this.
|
|
57
|
-
this.reorderDescriptionList = 0;
|
|
56
|
+
this.reset();
|
|
58
57
|
this.retryCount = 0;
|
|
59
|
-
this.lastRetryCounter = 0;
|
|
60
|
-
this.lastRetryConnectDescription = 0;
|
|
61
58
|
this.currentDescription = null;
|
|
62
59
|
this.descriptionList = new Array();
|
|
63
60
|
this.sBuf = new Array();
|
|
64
61
|
}
|
|
65
62
|
|
|
63
|
+
reset() {
|
|
64
|
+
this.nextOptToTry = 0;
|
|
65
|
+
this.lastRetryCounter = 0;
|
|
66
|
+
this.lastRetryConnectDescription = 0;
|
|
67
|
+
this.reorderDescriptionList = 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
66
70
|
hasMoreOptions() {
|
|
67
71
|
let cOptsSize = 0;
|
|
68
72
|
|
|
@@ -27,175 +27,175 @@
|
|
|
27
27
|
|
|
28
28
|
module.exports = {
|
|
29
29
|
// TNS packet types
|
|
30
|
-
NSPTCN
|
|
31
|
-
NSPTAC
|
|
32
|
-
NSPTAK
|
|
33
|
-
NSPTRF
|
|
34
|
-
NSPTRD
|
|
35
|
-
NSPTDA
|
|
36
|
-
NSPTNL
|
|
37
|
-
NSPTAB
|
|
38
|
-
NSPTRS
|
|
39
|
-
NSPTMK
|
|
40
|
-
NSPTAT
|
|
41
|
-
NSPTCNL
|
|
42
|
-
NSPTDD
|
|
43
|
-
NSPTHI
|
|
30
|
+
NSPTCN: 1, // Connect
|
|
31
|
+
NSPTAC: 2, // Accept
|
|
32
|
+
NSPTAK: 3, // Acknowledge
|
|
33
|
+
NSPTRF: 4, // Refuse
|
|
34
|
+
NSPTRD: 5, // Redirect
|
|
35
|
+
NSPTDA: 6, // Data
|
|
36
|
+
NSPTNL: 7, // Null
|
|
37
|
+
NSPTAB: 9, // Abort
|
|
38
|
+
NSPTRS: 11, // Re-send
|
|
39
|
+
NSPTMK: 12, // Marker
|
|
40
|
+
NSPTAT: 13, // Attention
|
|
41
|
+
NSPTCNL: 14, // Control information
|
|
42
|
+
NSPTDD: 15, // data descriptor
|
|
43
|
+
NSPTHI: 19, // Highest legal packet type
|
|
44
44
|
|
|
45
45
|
// Packet Header
|
|
46
|
-
NSPHDLEN
|
|
47
|
-
NSPHDPSM
|
|
48
|
-
NSPHDTYP
|
|
49
|
-
NSPHDFLGS
|
|
50
|
-
NSPHDHSM
|
|
51
|
-
NSPSIZHD
|
|
46
|
+
NSPHDLEN: 0, // Packet length
|
|
47
|
+
NSPHDPSM: 2, // Packet checksum(deprecated in version 3.15 with large sdu support)
|
|
48
|
+
NSPHDTYP: 4, // Packet type
|
|
49
|
+
NSPHDFLGS: 5, // Packet flags
|
|
50
|
+
NSPHDHSM: 6, // Header checksum
|
|
51
|
+
NSPSIZHD: 8, // Packet header size
|
|
52
52
|
|
|
53
53
|
/* Packet flags for NSPHDFLGS */
|
|
54
|
-
NSPFSID
|
|
55
|
-
NSPFRDS
|
|
56
|
-
NSPFRDR
|
|
57
|
-
NSPFLSD
|
|
58
|
-
NO_HEADER_FLAGS
|
|
59
|
-
NSPFSRN
|
|
54
|
+
NSPFSID: 0x01, // SID is given
|
|
55
|
+
NSPFRDS: 0x02, // ReDirect Separation of cnda vs cndo
|
|
56
|
+
NSPFRDR: 0x04, // ReDiRected client Connect (NSPTCN)
|
|
57
|
+
NSPFLSD: 0x20, // packet with large sdu field
|
|
58
|
+
NO_HEADER_FLAGS: 0,
|
|
59
|
+
NSPFSRN: 0x08,
|
|
60
60
|
|
|
61
61
|
// Connect Packet
|
|
62
|
-
NSPCNVSN
|
|
63
|
-
NSPCNLOV
|
|
64
|
-
NSPCNOPT
|
|
65
|
-
NSPCNSDU
|
|
66
|
-
NSPCNTDU
|
|
67
|
-
NSPCNNTC
|
|
68
|
-
NSPCNTNA
|
|
69
|
-
NSPCNONE
|
|
70
|
-
NSPCNLEN
|
|
71
|
-
NSPCNOFF
|
|
72
|
-
NSPCNMXC
|
|
73
|
-
NSPCNFL0
|
|
74
|
-
NSPCNFL1
|
|
75
|
-
NSPCNTMO
|
|
76
|
-
NSPCNTCK
|
|
77
|
-
NSPCNADL
|
|
78
|
-
NSPCNAOF
|
|
79
|
-
NSPCNLSD
|
|
80
|
-
NSPCNLTD
|
|
81
|
-
NSPCNCFL
|
|
82
|
-
NSPCNCFL2
|
|
62
|
+
NSPCNVSN: 8, // My version number
|
|
63
|
+
NSPCNLOV: 10, // Lowest version number I can be compatible with
|
|
64
|
+
NSPCNOPT: 12, // Global service options
|
|
65
|
+
NSPCNSDU: 14, // My SDU size
|
|
66
|
+
NSPCNTDU: 16, // Maximum TDU size
|
|
67
|
+
NSPCNNTC: 18, // NT characterstics
|
|
68
|
+
NSPCNTNA: 20, // Line turnaround value
|
|
69
|
+
NSPCNONE: 22, // The value '1' in my hardware byte order
|
|
70
|
+
NSPCNLEN: 24, // Length of connect data
|
|
71
|
+
NSPCNOFF: 26, // Offset to connect data
|
|
72
|
+
NSPCNMXC: 28, // Maximum connect data you can send me
|
|
73
|
+
NSPCNFL0: 32, // Connect flags
|
|
74
|
+
NSPCNFL1: 33,
|
|
75
|
+
NSPCNTMO: 50, // local connection timeout val
|
|
76
|
+
NSPCNTCK: 52, // local tick size
|
|
77
|
+
NSPCNADL: 54,
|
|
78
|
+
NSPCNAOF: 56, // offset to reconnect tns addr
|
|
79
|
+
NSPCNLSD: 58, // large sdu
|
|
80
|
+
NSPCNLTD: 62, // large tdu
|
|
81
|
+
NSPCNCFL: 66, // compression data
|
|
82
|
+
NSPCNCFL2: 70, // connect flag2
|
|
83
83
|
// NSPCNV310DAT : (NSPCNTMO + 8), start of connect data, V3.10 packet
|
|
84
84
|
// NSPCNV315DAT : (NSPCNCFL + 4),
|
|
85
|
-
NSPCNDAT
|
|
86
|
-
NSPMXCDATA
|
|
85
|
+
NSPCNDAT: 74, // Start connect data
|
|
86
|
+
NSPMXCDATA: 230, // Maximum length of connect data
|
|
87
87
|
// Connect flags (Used mostly by NA)
|
|
88
|
-
NSINAWANTED
|
|
89
|
-
NSINAINTCHG
|
|
88
|
+
NSINAWANTED: 0x01, // Want to use NA
|
|
89
|
+
NSINAINTCHG: 0x02, // Interchange involved
|
|
90
90
|
NSINADISABLEDFORCONNECTION: 0x04, // Disable NA
|
|
91
|
-
NSINANOSERVICES
|
|
92
|
-
NSINAREQUIRED
|
|
93
|
-
NSINAAUTHWANTED
|
|
94
|
-
NSISUPSECRENEG
|
|
91
|
+
NSINANOSERVICES: 0x08, // No NA services linked
|
|
92
|
+
NSINAREQUIRED: 0x10, // NA is required
|
|
93
|
+
NSINAAUTHWANTED: 0x20, // Authentication linked
|
|
94
|
+
NSISUPSECRENEG: 0x80, // bkwrd comp: SUPport SECurity RE-NEG
|
|
95
95
|
// Connect options
|
|
96
|
-
NSGDONTCARE
|
|
97
|
-
NSGHDX
|
|
98
|
-
NSGFDX
|
|
99
|
-
NSGHDRCHKSUM
|
|
100
|
-
NSGPAKCHKSUM
|
|
101
|
-
NSGBROKEN
|
|
102
|
-
NSGUSEVIO
|
|
103
|
-
NSGOSAUTHOK
|
|
104
|
-
NSGSENDATTN
|
|
105
|
-
NSGRECVATTN
|
|
106
|
-
NSGNOATTNPR
|
|
107
|
-
NSGRAW
|
|
108
|
-
TNS_VERSION_DESIRED
|
|
109
|
-
TNS_VERSION_MINIMUM
|
|
110
|
-
TNS_VERSION_MIN_UUID
|
|
111
|
-
TNS_UUID_OFFSET
|
|
96
|
+
NSGDONTCARE: 0x0001, // "don't care"
|
|
97
|
+
NSGHDX: 0x0002, // half-duplex (w/ token management)
|
|
98
|
+
NSGFDX: 0x0004, // full-duplex
|
|
99
|
+
NSGHDRCHKSUM: 0x0008, // checksum on packet header
|
|
100
|
+
NSGPAKCHKSUM: 0x0010, // checksum on entire packet
|
|
101
|
+
NSGBROKEN: 0x0020, // provide broken connection notification
|
|
102
|
+
NSGUSEVIO: 0x0040, // can use Vectored I/O
|
|
103
|
+
NSGOSAUTHOK: 0x0080, // use OS authentication
|
|
104
|
+
NSGSENDATTN: 0x0200, // can send attention
|
|
105
|
+
NSGRECVATTN: 0x0400, // can recv attention
|
|
106
|
+
NSGNOATTNPR: 0x0800, // no attention processing
|
|
107
|
+
NSGRAW: 0x1000, // I/O is direct to/from transport
|
|
108
|
+
TNS_VERSION_DESIRED: 319,
|
|
109
|
+
TNS_VERSION_MINIMUM: 300,
|
|
110
|
+
TNS_VERSION_MIN_UUID: 319,
|
|
111
|
+
TNS_UUID_OFFSET: 45,
|
|
112
112
|
|
|
113
113
|
/* Accept Packet */
|
|
114
|
-
NSPACVSN
|
|
115
|
-
NSPACOPT
|
|
116
|
-
NSPACSDU
|
|
117
|
-
NSPACTDU
|
|
118
|
-
NSPACONE
|
|
119
|
-
NSPACLEN
|
|
120
|
-
NSPACOFF
|
|
121
|
-
NSPACFL0
|
|
122
|
-
NSPACFL1
|
|
123
|
-
NSPACTMO
|
|
124
|
-
NSPACTCK
|
|
125
|
-
NSPACADL
|
|
126
|
-
NSPACAOF
|
|
127
|
-
NSPACLSD
|
|
128
|
-
NSPACLTD
|
|
129
|
-
NSPACCFL
|
|
130
|
-
NSPACFL2
|
|
131
|
-
NSPACV310DAT
|
|
132
|
-
NSPACV315DAT
|
|
114
|
+
NSPACVSN: 8, // connection version
|
|
115
|
+
NSPACOPT: 10, // global service options
|
|
116
|
+
NSPACSDU: 12, // SDU size
|
|
117
|
+
NSPACTDU: 14, // Maximum TDU
|
|
118
|
+
NSPACONE: 16, // The value '1' in my hardware byte order
|
|
119
|
+
NSPACLEN: 18, // connect data length
|
|
120
|
+
NSPACOFF: 20, // offset to connect data
|
|
121
|
+
NSPACFL0: 22, // connect flags
|
|
122
|
+
NSPACFL1: 23,
|
|
123
|
+
NSPACTMO: 24, // connection pool timeout value
|
|
124
|
+
NSPACTCK: 26, // local tick size
|
|
125
|
+
NSPACADL: 28, // reconnect tns address length
|
|
126
|
+
NSPACAOF: 30, // offset to reconnect tns addr
|
|
127
|
+
NSPACLSD: 32, // Large sdu
|
|
128
|
+
NSPACLTD: 36, // Large tdu
|
|
129
|
+
NSPACCFL: 40, // compression flag
|
|
130
|
+
NSPACFL2: 41, // accept flag2 (4 bytes)
|
|
131
|
+
NSPACV310DAT: 32, /* start of accept data, V3.10 packet */
|
|
132
|
+
NSPACV315DAT: 41, // start of accept data, V3.15 packet
|
|
133
133
|
|
|
134
134
|
/* Refuse Packet */
|
|
135
|
-
NSPRFURS
|
|
136
|
-
NSPRFSRS
|
|
137
|
-
NSPRFLEN
|
|
138
|
-
NSPRFDAT
|
|
135
|
+
NSPRFURS: 8, // User (appliction) reason for refusal
|
|
136
|
+
NSPRFSRS: 9, // System (NS) reason for
|
|
137
|
+
NSPRFLEN: 10, // Length of refuse data
|
|
138
|
+
NSPRFDAT: 12, // Start of connect data
|
|
139
139
|
// Compression flags
|
|
140
|
-
NSPACCFON
|
|
141
|
-
NSPACCFAT
|
|
142
|
-
NSPACCFNT
|
|
140
|
+
NSPACCFON: 0x80, // 1st MSB: compression on/off
|
|
141
|
+
NSPACCFAT: 0x40, // 2nd MSB : compression auto
|
|
142
|
+
NSPACCFNT: 0x02, // Second last LSB : compression for non-tcp protocol
|
|
143
143
|
// Accept flag2
|
|
144
|
-
NSPACOOB
|
|
145
|
-
NSGPCHKSCMD
|
|
144
|
+
NSPACOOB: 0x00000001, // OOB support check at connection time
|
|
145
|
+
NSGPCHKSCMD: 0x01000000, // Support for Poll and Check logic
|
|
146
146
|
|
|
147
147
|
/* Redirect packet */
|
|
148
|
-
NSPRDLEN
|
|
149
|
-
NSPRDDAT
|
|
148
|
+
NSPRDLEN: 8, // Length of redirect data
|
|
149
|
+
NSPRDDAT: 10, // Start of connect data
|
|
150
150
|
|
|
151
151
|
/* Data Packet */
|
|
152
|
-
NSPDAFLG
|
|
153
|
-
NSPDADAT
|
|
154
|
-
NSPDAFEOF
|
|
152
|
+
NSPDAFLG: 8, // Data flags
|
|
153
|
+
NSPDADAT: 10, // Start of Data
|
|
154
|
+
NSPDAFEOF: 0x40, // "end of file"
|
|
155
155
|
|
|
156
156
|
/* Marker Packet */
|
|
157
|
-
NSPMKTYP
|
|
158
|
-
NSPMKODT
|
|
159
|
-
NSPMKDAT
|
|
160
|
-
NSPMKTD0
|
|
161
|
-
NSPMKTD1
|
|
162
|
-
NSPMKTAT
|
|
163
|
-
NIQBMARK
|
|
164
|
-
NIQRMARK
|
|
165
|
-
NIQIMARK
|
|
157
|
+
NSPMKTYP: 8, // marker type (see below)
|
|
158
|
+
NSPMKODT: 9, // old (pre-V3.05) data byte
|
|
159
|
+
NSPMKDAT: 10, // data byte
|
|
160
|
+
NSPMKTD0: 0, // data marker - 0 data bytes
|
|
161
|
+
NSPMKTD1: 1, // data marker - 1 data byte
|
|
162
|
+
NSPMKTAT: 2, // Attention Marker
|
|
163
|
+
NIQBMARK: 1, // Break marker
|
|
164
|
+
NIQRMARK: 2, // Reset marker
|
|
165
|
+
NIQIMARK: 3, // Interrupt marker
|
|
166
166
|
|
|
167
167
|
/* Control Packet */
|
|
168
|
-
NSPCTLCMD
|
|
169
|
-
NSPCTLDAT
|
|
170
|
-
NSPCTL_SERR
|
|
171
|
-
NSPCTL_CLRATTN
|
|
168
|
+
NSPCTLCMD: 8, // Control Command length is 2 bytes
|
|
169
|
+
NSPCTLDAT: 10, // Control Data length is specific to the Command type.
|
|
170
|
+
NSPCTL_SERR: 8, // Error Control Command Type
|
|
171
|
+
NSPCTL_CLRATTN: 9, // Clear OOB option
|
|
172
172
|
|
|
173
173
|
/* OPTIONS */
|
|
174
|
-
NSPDFSDULN
|
|
175
|
-
NSPABSSDULN
|
|
176
|
-
NSPMXSDULN
|
|
177
|
-
NSPMNSDULN
|
|
178
|
-
NSPDFTDULN
|
|
179
|
-
NSPMXTDULN
|
|
180
|
-
NSPMNTDULN
|
|
181
|
-
NSFIMM
|
|
174
|
+
NSPDFSDULN: 8192, // default SDU size
|
|
175
|
+
NSPABSSDULN: 2097152, // maximim SDU size
|
|
176
|
+
NSPMXSDULN: 65535, // maximim SDU size
|
|
177
|
+
NSPMNSDULN: 512, // minimum SDU size
|
|
178
|
+
NSPDFTDULN: 2097152, // default TDU size
|
|
179
|
+
NSPMXTDULN: 2097152, // maximum TDU size
|
|
180
|
+
NSPMNTDULN: 255, // minimum TDU size
|
|
181
|
+
NSFIMM: 0x0040, // immediate close
|
|
182
182
|
|
|
183
183
|
/* PARAMETERS */
|
|
184
|
-
DISABLE_OOB_STR
|
|
185
|
-
EXPIRE_TIME
|
|
186
|
-
PEM_WALLET_FILE_NAME
|
|
184
|
+
DISABLE_OOB_STR: 'DISABLE_OOB', // disable OOB parameter
|
|
185
|
+
EXPIRE_TIME: 'EXPIRE_TIME', // expire Time
|
|
186
|
+
PEM_WALLET_FILE_NAME: 'ewallet.pem',
|
|
187
187
|
|
|
188
188
|
/* Get/Set options */
|
|
189
|
-
NT_MOREDATA
|
|
190
|
-
NS_MOREDATA
|
|
191
|
-
SVCNAME
|
|
192
|
-
SERVERTYPE
|
|
193
|
-
REMOTEADDR
|
|
194
|
-
HEALTHCHECK
|
|
195
|
-
CONNCLASS
|
|
196
|
-
PURITY
|
|
197
|
-
SID
|
|
189
|
+
NT_MOREDATA: 1, // More Data in Transport available
|
|
190
|
+
NS_MOREDATA: 2, // More Data available to be read
|
|
191
|
+
SVCNAME: 3, // Service name
|
|
192
|
+
SERVERTYPE: 4, // Server type
|
|
193
|
+
REMOTEADDR: 5, // Remote Address
|
|
194
|
+
HEALTHCHECK: 6, // Health check of connection
|
|
195
|
+
CONNCLASS: 7, // Connection Class
|
|
196
|
+
PURITY: 8, // Purity
|
|
197
|
+
SID: 9, // SID
|
|
198
198
|
|
|
199
199
|
/* FLAGS */
|
|
200
|
-
NSNOBLOCK
|
|
200
|
+
NSNOBLOCK: 0x0001, // Do not block
|
|
201
201
|
};
|
|
@@ -35,10 +35,10 @@ const dnsPromises = dns.promises;
|
|
|
35
35
|
const cInfo = require("../util.js").CLIENT_INFO;
|
|
36
36
|
|
|
37
37
|
const SchemaObjectFactoryInterface = {
|
|
38
|
-
ADDR:0,
|
|
39
|
-
ADDR_LIST:1,
|
|
40
|
-
DESC:2,
|
|
41
|
-
DESC_LIST:3,
|
|
38
|
+
ADDR: 0,
|
|
39
|
+
ADDR_LIST: 1,
|
|
40
|
+
DESC: 2,
|
|
41
|
+
DESC_LIST: 3,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -451,7 +451,7 @@ const NavSchemaObject = {
|
|
|
451
451
|
CONID: "(CONNECTION_ID="
|
|
452
452
|
};
|
|
453
453
|
const options = {
|
|
454
|
-
all:true,
|
|
454
|
+
all: true,
|
|
455
455
|
};
|
|
456
456
|
/**
|
|
457
457
|
* Class that navigates the address node in the tree.
|
|
@@ -46,6 +46,7 @@ const downHostInstance = require("./connStrategy.js").SOLE_INST_DHCACHE;
|
|
|
46
46
|
|
|
47
47
|
async function getConnectionInfo(userConfig) {
|
|
48
48
|
const connStr = await resolveConnectStr(userConfig.connectString, userConfig.configDir);
|
|
49
|
+
const addressNode = await createNode(connStr);
|
|
49
50
|
let nvpair;
|
|
50
51
|
if (typeof connStr === 'string')
|
|
51
52
|
nvpair = createNVPair(connStr);
|
|
@@ -58,7 +59,7 @@ async function getConnectionInfo(userConfig) {
|
|
|
58
59
|
const sid = findValue(nvpair, ["DESCRIPTION", "CONNECT_DATA", "SID"]);
|
|
59
60
|
const poolPurity = findValue(nvpair, ["DESCRIPTION", "CONNECT_DATA", "POOL_PURITY"]);
|
|
60
61
|
|
|
61
|
-
return [serverVal, connClass, svcname, poolPurity, sid ];
|
|
62
|
+
return [serverVal, connClass, svcname, poolPurity, sid, addressNode ];
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/**
|
|
@@ -510,7 +511,13 @@ class NetworkSession {
|
|
|
510
511
|
*/
|
|
511
512
|
async connect(userConfig) {
|
|
512
513
|
const connStr = userConfig.connectString ? userConfig.connectString : userConfig.connectionString;
|
|
513
|
-
|
|
514
|
+
let addressNode;
|
|
515
|
+
if (userConfig._connInfo) {
|
|
516
|
+
addressNode = userConfig._connInfo[5];
|
|
517
|
+
addressNode.reset();
|
|
518
|
+
} else {
|
|
519
|
+
addressNode = await resolveAddress(connStr, userConfig.configDir);
|
|
520
|
+
}
|
|
514
521
|
let address;
|
|
515
522
|
try {
|
|
516
523
|
address = await this.getAddress(addressNode, userConfig);
|
package/lib/thin/sqlnet/ntTcp.js
CHANGED
|
@@ -228,10 +228,10 @@ class NTTCP {
|
|
|
228
228
|
this.doDNMatch = false; //Don't match initial connect
|
|
229
229
|
try {
|
|
230
230
|
secureContext = tls.createSecureContext({
|
|
231
|
-
cert
|
|
232
|
-
key
|
|
231
|
+
cert: this.atts.wallet,
|
|
232
|
+
key: this.atts.wallet,
|
|
233
233
|
passphrase: this.atts.walletPassword,
|
|
234
|
-
ca
|
|
234
|
+
ca: this.atts.wallet,
|
|
235
235
|
});
|
|
236
236
|
} catch (err) {
|
|
237
237
|
errors.throwErr(errors.ERR_TLS_INIT_FAILURE);
|
|
@@ -415,7 +415,7 @@ class NTTCP {
|
|
|
415
415
|
buf: tempBuf.subarray(0, len),
|
|
416
416
|
type: tempBuf[4],
|
|
417
417
|
flags: tempBuf[5],
|
|
418
|
-
num
|
|
418
|
+
num: this.packetNum++
|
|
419
419
|
};
|
|
420
420
|
this.packets.push(packet);
|
|
421
421
|
if (this.readWaiter) {
|
|
@@ -474,10 +474,10 @@ class NTTCP {
|
|
|
474
474
|
this.checkErr();
|
|
475
475
|
this.doDNMatch = true;
|
|
476
476
|
const secureContext = tls.createSecureContext({
|
|
477
|
-
cert
|
|
478
|
-
key
|
|
477
|
+
cert: this.atts.wallet,
|
|
478
|
+
key: this.atts.wallet,
|
|
479
479
|
passphrase: this.atts.walletPassword,
|
|
480
|
-
ca
|
|
480
|
+
ca: this.atts.wallet,
|
|
481
481
|
});
|
|
482
482
|
await this.tlsConnect(secureContext, this.connStream);
|
|
483
483
|
} finally {
|
package/lib/thin/statement.js
CHANGED
package/lib/thin/util.js
CHANGED
|
@@ -110,9 +110,9 @@ function checkProxyUserValidity(userName) {
|
|
|
110
110
|
let quoteFound = false, openSquareBracketFound = false;
|
|
111
111
|
let lastQuoteFoundIndex = 0;
|
|
112
112
|
const result = {
|
|
113
|
-
status
|
|
114
|
-
proxyUser
|
|
115
|
-
schemaUser
|
|
113
|
+
status: -1,
|
|
114
|
+
proxyUser: '',
|
|
115
|
+
schemaUser: ''
|
|
116
116
|
};
|
|
117
117
|
const userNameLength = userName.length;
|
|
118
118
|
let index = 0, i, j;
|
|
@@ -238,10 +238,21 @@ function checkCredentials(params) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
//---------------------------------------------------------------------------
|
|
242
|
+
// normalizePrivateKey()
|
|
243
|
+
//
|
|
244
|
+
// Add header and footer to private key
|
|
245
|
+
//---------------------------------------------------------------------------
|
|
246
|
+
function normalizePrivateKey(privateKey) {
|
|
247
|
+
return '-----BEGIN PRIVATE KEY-----\n' + privateKey +
|
|
248
|
+
'\n' + '-----END PRIVATE KEY-----';
|
|
249
|
+
}
|
|
250
|
+
|
|
241
251
|
module.exports = {
|
|
242
252
|
getMetadataMany,
|
|
243
253
|
CLIENT_INFO,
|
|
244
254
|
getOutBinds,
|
|
245
255
|
checkProxyUserValidity,
|
|
246
|
-
checkCredentials
|
|
256
|
+
checkCredentials,
|
|
257
|
+
normalizePrivateKey
|
|
247
258
|
};
|
package/lib/types.js
CHANGED
|
@@ -196,6 +196,9 @@ const DB_TYPE_UROWID = new DbType(2030,
|
|
|
196
196
|
const DB_TYPE_VARCHAR = new DbType(2001,
|
|
197
197
|
"DB_TYPE_VARCHAR", "VARCHAR2",
|
|
198
198
|
{ oraTypeNum: 1, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 4 });
|
|
199
|
+
const DB_TYPE_XMLTYPE = new DbType(2032,
|
|
200
|
+
"DB_TYPE_XMLTYPE", "XMLTYPE",
|
|
201
|
+
{ oraTypeNum: 109, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 2147483647 });
|
|
199
202
|
|
|
200
203
|
// database type conversion map: the top level key refers to the database
|
|
201
204
|
// type being fetched and the value is another map; this map's key is the
|
|
@@ -304,7 +307,8 @@ const DB_TYPE_FETCH_TYPE_MAP = new Map([
|
|
|
304
307
|
[DB_TYPE_TIMESTAMP_LTZ, DB_TYPE_TIMESTAMP_TZ],
|
|
305
308
|
[DB_TYPE_TIMESTAMP_TZ, DB_TYPE_TIMESTAMP_TZ],
|
|
306
309
|
[DB_TYPE_UROWID, DB_TYPE_UROWID],
|
|
307
|
-
[DB_TYPE_VARCHAR, DB_TYPE_VARCHAR]
|
|
310
|
+
[DB_TYPE_VARCHAR, DB_TYPE_VARCHAR],
|
|
311
|
+
[DB_TYPE_XMLTYPE, DB_TYPE_XMLTYPE]
|
|
308
312
|
]);
|
|
309
313
|
|
|
310
314
|
// additional aliases for types by column type name
|
|
@@ -351,6 +355,7 @@ module.exports = {
|
|
|
351
355
|
DB_TYPE_VARCHAR,
|
|
352
356
|
DB_TYPE_CONVERSION_MAP,
|
|
353
357
|
DB_TYPE_FETCH_TYPE_MAP,
|
|
358
|
+
DB_TYPE_XMLTYPE,
|
|
354
359
|
getTypeByColumnTypeName,
|
|
355
360
|
getTypeByNum,
|
|
356
361
|
getTypeByOraTypeNum
|