oracledb 6.5.0 → 6.6.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.6.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.6.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.6.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.6.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.6.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.6.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-win32-x64.node-buildinfo.txt +1 -0
- package/examples/README.md +4 -0
- package/lib/configProviders/azure.js +167 -0
- package/lib/configProviders/base.js +99 -0
- package/lib/configProviders/ociobject.js +203 -0
- package/lib/connection.js +28 -12
- package/lib/constants.js +1 -0
- package/lib/errors.js +68 -1
- package/lib/impl/datahandlers/buffer.js +2 -2
- package/lib/impl/datahandlers/constants.js +3 -1
- package/lib/impl/datahandlers/vector.js +24 -9
- package/lib/impl/lob.js +27 -0
- package/lib/impl/resultset.js +26 -1
- package/lib/lob.js +52 -1
- package/lib/oracledb.js +61 -34
- package/lib/pool.js +7 -0
- package/lib/thin/connection.js +232 -16
- package/lib/thin/dbObject.js +4 -0
- package/lib/thin/lob.js +193 -1
- package/lib/thin/pool.js +15 -0
- package/lib/thin/protocol/capabilities.js +2 -0
- package/lib/thin/protocol/constants.js +30 -1
- package/lib/thin/protocol/messages/index.js +5 -1
- package/lib/thin/protocol/messages/lobOp.js +17 -5
- package/lib/thin/protocol/messages/transactionChangeState.js +99 -0
- package/lib/thin/protocol/messages/transactionSwitch.js +139 -0
- package/lib/thin/protocol/messages/withData.js +37 -8
- package/lib/thin/protocol/protocol.js +4 -0
- package/lib/thin/sqlnet/networkSession.js +2 -1
- package/lib/thin/sqlnet/packet.js +3 -1
- package/lib/thin/sqlnet/paramParser.js +87 -50
- package/lib/thin/sqlnet/sessionAtts.js +13 -1
- package/lib/thin/statement.js +4 -0
- package/lib/thin/statementCache.js +5 -0
- package/lib/transformer.js +1 -2
- package/lib/types.js +1 -1
- package/lib/util.js +62 -2
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/build/Release/oracledb-6.5.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.5.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.5.0-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.5.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.5.0-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.5.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.5.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.5.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.5.0-win32-x64.node-buildinfo.txt +0 -1
|
@@ -492,12 +492,17 @@ module.exports = {
|
|
|
492
492
|
TNS_LOB_OP_CLOSE: 0x10000,
|
|
493
493
|
TNS_LOB_OP_IS_OPEN: 0x11000,
|
|
494
494
|
TNS_LOB_OP_ARRAY: 0x80000,
|
|
495
|
+
TNS_LOB_OP_FILE_OPEN: 0x0100,
|
|
496
|
+
TNS_LOB_OP_FILE_CLOSE: 0x0200,
|
|
497
|
+
TNS_LOB_OP_FILE_ISOPEN: 0x0400,
|
|
498
|
+
TNS_LOB_OP_FILE_EXISTS: 0x0800,
|
|
495
499
|
|
|
496
500
|
// LOB locator constants
|
|
497
501
|
TNS_LOB_LOC_OFFSET_FLAG_1: 4,
|
|
498
502
|
TNS_LOB_LOC_OFFSET_FLAG_3: 6,
|
|
499
503
|
TNS_LOB_LOC_OFFSET_FLAG_4: 7,
|
|
500
504
|
TNS_LOB_QLOCATOR_VERSION: 4,
|
|
505
|
+
TNS_LOB_LOC_FIXED_OFFSET: 16,
|
|
501
506
|
|
|
502
507
|
// LOB locator flags (byte 1)
|
|
503
508
|
TNS_LOB_LOC_FLAGS_BLOB: 0x01,
|
|
@@ -513,6 +518,7 @@ module.exports = {
|
|
|
513
518
|
|
|
514
519
|
// other LOB constants
|
|
515
520
|
TNS_LOB_OPEN_READ_WRITE: 2,
|
|
521
|
+
TNS_LOB_OPEN_READ_ONLY: 11,
|
|
516
522
|
TNS_LOB_PREFETCH_FLAG: 0x2000000,
|
|
517
523
|
|
|
518
524
|
// base JSON constants
|
|
@@ -548,6 +554,8 @@ module.exports = {
|
|
|
548
554
|
TNS_FUNC_SESSION_RELEASE: 163,
|
|
549
555
|
TNS_FUNC_SESSION_STATE: 176, // piggyback fn
|
|
550
556
|
TNS_FUNC_CANCEL_ALL: 120, // piggyback fn
|
|
557
|
+
TNS_FUNC_TPC_TXN_SWITCH: 103,
|
|
558
|
+
TNS_FUNC_TPC_TXN_CHANGE_STATE: 104,
|
|
551
559
|
|
|
552
560
|
// character sets and encodings
|
|
553
561
|
TNS_CHARSET_UTF8: 873,
|
|
@@ -578,7 +586,8 @@ module.exports = {
|
|
|
578
586
|
TNS_CCAP_TTC4: 40,
|
|
579
587
|
TNS_CCAP_LOB2: 42,
|
|
580
588
|
TNS_CCAP_TTC5: 44,
|
|
581
|
-
|
|
589
|
+
TNS_CCAP_VECTOR_FEATURES: 52,
|
|
590
|
+
TNS_CCAP_MAX: 53,
|
|
582
591
|
|
|
583
592
|
// compile time capability values
|
|
584
593
|
TNS_CCAP_SQL_VERSION_MAX: 6,
|
|
@@ -634,6 +643,7 @@ module.exports = {
|
|
|
634
643
|
TNS_CCAP_LOB2_2GB_PREFETCH: 0x04,
|
|
635
644
|
TNS_CCAP_CTB_IMPLICIT_POOL: 0x08,
|
|
636
645
|
TNS_CCAP_VECTOR_SUPPORT: 0x08,
|
|
646
|
+
TNS_CCAP_VECTOR_FEATURE_BINARY: 0x01,
|
|
637
647
|
|
|
638
648
|
// runtime capability indices
|
|
639
649
|
TNS_RCAP_COMPAT: 0,
|
|
@@ -660,6 +670,24 @@ module.exports = {
|
|
|
660
670
|
TNS_EOCS_FLAGS_TXN_IN_PROGRESS: 0x00000002,
|
|
661
671
|
TNS_EOCS_FLAGS_SESS_RELEASE: 0x00008000,
|
|
662
672
|
|
|
673
|
+
// transaction switching op codes
|
|
674
|
+
TNS_TPC_TXN_START: 0x01,
|
|
675
|
+
TNS_TPC_TXN_DETACH: 0x02,
|
|
676
|
+
|
|
677
|
+
// transaction change state op codes
|
|
678
|
+
TNS_TPC_TXN_COMMIT: 0x01,
|
|
679
|
+
TNS_TPC_TXN_ABORT: 0x02,
|
|
680
|
+
TNS_TPC_TXN_PREPARE: 0x03,
|
|
681
|
+
TNS_TPC_TXN_FORGET: 0x04,
|
|
682
|
+
|
|
683
|
+
// transaction states
|
|
684
|
+
TNS_TPC_TXN_STATE_PREPARE: 0,
|
|
685
|
+
TNS_TPC_TXN_STATE_REQUIRES_COMMIT: 1,
|
|
686
|
+
TNS_TPC_TXN_STATE_COMMITTED: 2,
|
|
687
|
+
TNS_TPC_TXN_STATE_ABORTED: 3,
|
|
688
|
+
TNS_TPC_TXN_STATE_READ_ONLY: 4,
|
|
689
|
+
TNS_TPC_TXN_STATE_FORGOTTEN: 5,
|
|
690
|
+
|
|
663
691
|
// other constants
|
|
664
692
|
TNS_ESCAPE_CHAR: 253,
|
|
665
693
|
TNS_LONG_LENGTH_INDICATOR: dataHandlerConstants.TNS_LONG_LENGTH_INDICATOR,
|
|
@@ -724,6 +752,7 @@ module.exports = {
|
|
|
724
752
|
TNS_XML_TYPE_FLAG_SKIP_NEXT_4: 0x100000,
|
|
725
753
|
|
|
726
754
|
// errors
|
|
755
|
+
TNS_ERR_INCONSISTENT_DATA_TYPES: 932,
|
|
727
756
|
TNS_ERR_VAR_NOT_IN_SELECT_LIST: 1007,
|
|
728
757
|
TNS_ERR_INBAND_MESSAGE: 12573,
|
|
729
758
|
TNS_ERR_INVALID_SERVICE_NAME: 12514,
|
|
@@ -38,6 +38,8 @@ const ProtocolMessage = require('./protocol.js');
|
|
|
38
38
|
const RollbackMessage = require('./rollback.js');
|
|
39
39
|
const SessionReleaseMessage = require('./sessionRelease.js');
|
|
40
40
|
const FastAuthMessage = require('./fastAuth.js');
|
|
41
|
+
const TransactionChangeStateMessage = require('./transactionChangeState.js');
|
|
42
|
+
const TransactionSwitchMessage = require('./transactionSwitch.js');
|
|
41
43
|
|
|
42
44
|
module.exports = {
|
|
43
45
|
AuthMessage,
|
|
@@ -51,5 +53,7 @@ module.exports = {
|
|
|
51
53
|
PingMessage,
|
|
52
54
|
ProtocolMessage,
|
|
53
55
|
RollbackMessage,
|
|
54
|
-
SessionReleaseMessage
|
|
56
|
+
SessionReleaseMessage,
|
|
57
|
+
TransactionChangeStateMessage,
|
|
58
|
+
TransactionSwitchMessage
|
|
55
59
|
};
|
|
@@ -90,8 +90,13 @@ class LobOpMessage extends Message {
|
|
|
90
90
|
buf.writeUInt8(0);
|
|
91
91
|
}
|
|
92
92
|
buf.writeUInt8(0);
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
const operations = [
|
|
94
|
+
constants.TNS_LOB_OP_CREATE_TEMP,
|
|
95
|
+
constants.TNS_LOB_OP_IS_OPEN,
|
|
96
|
+
constants.TNS_LOB_OP_FILE_EXISTS,
|
|
97
|
+
constants.TNS_LOB_OP_FILE_ISOPEN,
|
|
98
|
+
];
|
|
99
|
+
if (operations.includes(this.operation)) {
|
|
95
100
|
buf.writeUInt8(1);
|
|
96
101
|
} else {
|
|
97
102
|
buf.writeUInt8(0);
|
|
@@ -152,7 +157,10 @@ class LobOpMessage extends Message {
|
|
|
152
157
|
const oraTypeNum = this.sourceLobImpl.dbType._oraTypeNum;
|
|
153
158
|
let data = buf.readBytesWithLength();
|
|
154
159
|
if (data !== null) {
|
|
155
|
-
if (
|
|
160
|
+
if (
|
|
161
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BLOB ||
|
|
162
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BFILE
|
|
163
|
+
) {
|
|
156
164
|
data = Buffer.from(data);
|
|
157
165
|
} else if (this.sourceLobImpl.getCsfrm() === constants.CSFRM_NCHAR) {
|
|
158
166
|
data = Buffer.from(data).swap16().toString('utf16le');
|
|
@@ -189,8 +197,12 @@ class LobOpMessage extends Message {
|
|
|
189
197
|
} else if (this.sendAmount) {
|
|
190
198
|
this.amount = buf.readSB8();
|
|
191
199
|
}
|
|
192
|
-
if (
|
|
193
|
-
|
|
200
|
+
if (
|
|
201
|
+
this.operation === constants.TNS_LOB_OP_IS_OPEN
|
|
202
|
+
|| this.operation === constants.TNS_LOB_OP_FILE_EXISTS
|
|
203
|
+
|| this.operation === constants.TNS_LOB_OP_FILE_ISOPEN
|
|
204
|
+
) {
|
|
205
|
+
temp8 = buf.readUInt8();
|
|
194
206
|
this.boolFlag = temp8 > 0;
|
|
195
207
|
}
|
|
196
208
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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 http://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
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
'use strict';
|
|
28
|
+
|
|
29
|
+
const Message = require("./base.js");
|
|
30
|
+
const constants = require("../constants.js");
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Used for two-phase commit (TPC) transaction change state: commit, rollback,
|
|
34
|
+
* forget, etc.
|
|
35
|
+
*
|
|
36
|
+
* @class TransactionChangeStateMessage
|
|
37
|
+
* @extends {Message}
|
|
38
|
+
*/
|
|
39
|
+
class TransactionChangeStateMessage extends Message {
|
|
40
|
+
|
|
41
|
+
constructor(connImpl) {
|
|
42
|
+
super(connImpl);
|
|
43
|
+
this.functionCode = constants.TNS_FUNC_TPC_TXN_CHANGE_STATE;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
processReturnParameter(buf) {
|
|
47
|
+
// process the parameters returned by the datatabase
|
|
48
|
+
this.state = buf.readUB4();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
encode(buf) {
|
|
52
|
+
// writes the message to the database
|
|
53
|
+
// acquire data to send to the server
|
|
54
|
+
let xidBytes;
|
|
55
|
+
if (this.xid) {
|
|
56
|
+
xidBytes = Buffer.alloc(128);
|
|
57
|
+
this.xid.globalTransactionId.copy(xidBytes);
|
|
58
|
+
this.xid.branchQualifier.copy(xidBytes,
|
|
59
|
+
this.xid.globalTransactionId.length);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
this.writeFunctionHeader(buf);
|
|
63
|
+
buf.writeUB4(this.operation);
|
|
64
|
+
if (this.context) {
|
|
65
|
+
buf.writeUInt8(1);
|
|
66
|
+
buf.writeUB4(this.context.length);
|
|
67
|
+
} else {
|
|
68
|
+
buf.writeUInt8(0);
|
|
69
|
+
buf.writeUB4(0);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (this.xid) {
|
|
73
|
+
buf.writeUB4(this.xid.formatId);
|
|
74
|
+
buf.writeUB4(this.xid.globalTransactionId.length);
|
|
75
|
+
buf.writeUB4(this.xid.branchQualifier.length);
|
|
76
|
+
buf.writeUInt8(1);
|
|
77
|
+
buf.writeUB4(xidBytes.length);
|
|
78
|
+
} else {
|
|
79
|
+
buf.writeUB4(0);
|
|
80
|
+
buf.writeUB4(0);
|
|
81
|
+
buf.writeUB4(0);
|
|
82
|
+
buf.writeUInt8(0);
|
|
83
|
+
buf.writeUB4(0);
|
|
84
|
+
}
|
|
85
|
+
buf.writeUB4(0);
|
|
86
|
+
buf.writeUB4(this.state);
|
|
87
|
+
buf.writeUInt8(1);
|
|
88
|
+
buf.writeUB4(this.flags);
|
|
89
|
+
|
|
90
|
+
if (this.context) {
|
|
91
|
+
buf.writeBytes(this.context);
|
|
92
|
+
}
|
|
93
|
+
if (this.xid) {
|
|
94
|
+
buf.writeBytes(xidBytes);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = TransactionChangeStateMessage;
|
|
@@ -0,0 +1,139 @@
|
|
|
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 http://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
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
'use strict';
|
|
28
|
+
|
|
29
|
+
const Message = require("./base.js");
|
|
30
|
+
const constants = require("../constants.js");
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Used for two-phase commit (TPC) transaction start, attach and detach.
|
|
34
|
+
*
|
|
35
|
+
* @class TransactionSwitchMessage
|
|
36
|
+
* @extends {Message}
|
|
37
|
+
*/
|
|
38
|
+
class TransactionSwitchMessage extends Message {
|
|
39
|
+
|
|
40
|
+
constructor(connImpl) {
|
|
41
|
+
super(connImpl);
|
|
42
|
+
this.functionCode = constants.TNS_FUNC_TPC_TXN_SWITCH;
|
|
43
|
+
this.applicationValue = 0;
|
|
44
|
+
this.internalName = connImpl.internalName;
|
|
45
|
+
if (this.internalName) {
|
|
46
|
+
this.internalName = Buffer.from(this.internalName);
|
|
47
|
+
}
|
|
48
|
+
this.externalName = connImpl.externalName;
|
|
49
|
+
if (this.externalName) {
|
|
50
|
+
this.externalName = Buffer.from(this.externalName);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
processReturnParameter(buf) {
|
|
55
|
+
// process the parameters returned by the datatabase
|
|
56
|
+
this.applicationValue = buf.readUB4();
|
|
57
|
+
this.contextLen = buf.readUB2();
|
|
58
|
+
if (this.contextLen > 0) {
|
|
59
|
+
this.context = Buffer.from(buf.readBytes(this.contextLen));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
encode(buf) {
|
|
64
|
+
// writes the message to the database
|
|
65
|
+
// acquire data to send to the server
|
|
66
|
+
let xidBytes;
|
|
67
|
+
if (this.xid) {
|
|
68
|
+
xidBytes = Buffer.alloc(128);
|
|
69
|
+
this.xid.globalTransactionId.copy(xidBytes);
|
|
70
|
+
this.xid.branchQualifier.copy(xidBytes,
|
|
71
|
+
this.xid.globalTransactionId.length);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// write message
|
|
75
|
+
this.writeFunctionHeader(buf);
|
|
76
|
+
buf.writeUB4(this.operation);
|
|
77
|
+
if (this.context) {
|
|
78
|
+
buf.writeUInt8(1); // pointer (transaction context)
|
|
79
|
+
buf.writeUB4(this.context.length);
|
|
80
|
+
} else {
|
|
81
|
+
buf.writeUInt8(0); // pointer (transaction context)
|
|
82
|
+
buf.writeUB4(0); // transaction context length
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (this.xid) {
|
|
86
|
+
buf.writeUB4(this.xid.formatId);
|
|
87
|
+
buf.writeUB4(this.xid.globalTransactionId.length);
|
|
88
|
+
buf.writeUB4(this.xid.branchQualifier.length);
|
|
89
|
+
buf.writeUInt8(1); // pointer (XID)
|
|
90
|
+
buf.writeUB4(xidBytes.length);
|
|
91
|
+
} else {
|
|
92
|
+
buf.writeUB4(0); // format id
|
|
93
|
+
buf.writeUB4(0); // global transaction id length
|
|
94
|
+
buf.writeUB4(0); // branch qualifier length
|
|
95
|
+
buf.writeUInt8(0); // pointer (XID)
|
|
96
|
+
buf.writeUB4(0); // XID length
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
buf.writeUB4(this.flags);
|
|
100
|
+
buf.writeUB4(this.timeout);
|
|
101
|
+
buf.writeUInt8(1); // pointer (application value)
|
|
102
|
+
buf.writeUInt8(1); // pointer (return context)
|
|
103
|
+
buf.writeUInt8(1); // pointer (return context length)
|
|
104
|
+
|
|
105
|
+
if (this.internalName) {
|
|
106
|
+
buf.writeUInt8(1); // pointer (internal name)
|
|
107
|
+
buf.writeUB4(this.internalName.length);
|
|
108
|
+
} else {
|
|
109
|
+
buf.writeUInt8(0); // pointer (internal name)
|
|
110
|
+
buf.writeUB4(0); // length of internal name
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (this.externalName) {
|
|
114
|
+
buf.writeUInt8(1); // pointer (external name)
|
|
115
|
+
buf.writeUB4(this.externalName.length);
|
|
116
|
+
} else {
|
|
117
|
+
buf.writeUInt8(0); // pointer (external name)
|
|
118
|
+
buf.writeUB4(0); // length of external name
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (this.context) {
|
|
122
|
+
buf.writeBytes(this.context);
|
|
123
|
+
}
|
|
124
|
+
if (this.xid) {
|
|
125
|
+
buf.writeBytes(xidBytes);
|
|
126
|
+
}
|
|
127
|
+
buf.writeUB4(this.applicationValue);
|
|
128
|
+
|
|
129
|
+
if (this.internalName) {
|
|
130
|
+
buf.writeBytes(this.internalName);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (this.externalName) {
|
|
134
|
+
buf.writeBytes(this.externalName);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
module.exports = TransactionSwitchMessage;
|
|
@@ -113,9 +113,18 @@ class MessageWithData extends Message {
|
|
|
113
113
|
this.errorInfo.num = 0;
|
|
114
114
|
this.errorOccurred = false;
|
|
115
115
|
this.statement.moreRowsToFetch = false;
|
|
116
|
+
} else if (this.retry) {
|
|
117
|
+
this.retry = false;
|
|
118
|
+
} else if (this.statement.isQuery &&
|
|
119
|
+
(this.errorInfo.num === constants.TNS_ERR_VAR_NOT_IN_SELECT_LIST
|
|
120
|
+
|| this.errorInfo.num === constants.TNS_ERR_INCONSISTENT_DATA_TYPES)) {
|
|
121
|
+
this.retry = true;
|
|
122
|
+
this.connection.statementCache.clearCursor(this.statement);
|
|
116
123
|
} else if (this.errorInfo.num !== 0 && this.errorInfo.cursorId !== 0) {
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
if (!errors.ERR_INTEGRITY_ERROR_CODES.includes(this.errorInfo.num)) {
|
|
125
|
+
this.connection.statementCache.clearCursor(this.statement);
|
|
126
|
+
this.statement.returnToCache = false;
|
|
127
|
+
}
|
|
119
128
|
}
|
|
120
129
|
if (this.errorInfo.batchErrors) {
|
|
121
130
|
this.errorOccurred = false;
|
|
@@ -131,7 +140,11 @@ class MessageWithData extends Message {
|
|
|
131
140
|
if ((cVar.fetchInfo.dbType._oraTypeNum === constants.TNS_DATA_TYPE_CLOB
|
|
132
141
|
&& pVar.fetchInfo.fetchType._oraTypeNum === constants.TNS_DATA_TYPE_LONG)
|
|
133
142
|
|| (cVar.fetchInfo.dbType._oraTypeNum === constants.TNS_DATA_TYPE_BLOB
|
|
134
|
-
&& pVar.fetchInfo.fetchType._oraTypeNum === constants.TNS_DATA_TYPE_LONG_RAW)
|
|
143
|
+
&& pVar.fetchInfo.fetchType._oraTypeNum === constants.TNS_DATA_TYPE_LONG_RAW)
|
|
144
|
+
|| (cVar.fetchInfo.dbType._oraTypeNum === constants.TNS_DATA_TYPE_JSON
|
|
145
|
+
&& pVar.fetchInfo.fetchType._oraTypeNum === constants.TNS_DATA_TYPE_VARCHAR)
|
|
146
|
+
|| (cVar.fetchInfo.dbType._oraTypeNum === constants.TNS_DATA_TYPE_VECTOR
|
|
147
|
+
&& pVar.fetchInfo.fetchType._oraTypeNum === constants.TNS_DATA_TYPE_LONG)) {
|
|
135
148
|
cVar.type = pVar.fetchInfo.fetchType;
|
|
136
149
|
cVar.maxSize = pVar.maxSize;
|
|
137
150
|
}
|
|
@@ -489,12 +502,22 @@ class MessageWithData extends Message {
|
|
|
489
502
|
}
|
|
490
503
|
} else if (oraTypeNum === constants.TNS_DATA_TYPE_BOOLEAN) {
|
|
491
504
|
colValue = buf.readBool();
|
|
492
|
-
} else if (
|
|
505
|
+
} else if (
|
|
506
|
+
oraTypeNum === constants.TNS_DATA_TYPE_CLOB ||
|
|
507
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BLOB ||
|
|
508
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BFILE
|
|
509
|
+
) {
|
|
510
|
+
let length = 0;
|
|
511
|
+
let chunkSize = 0;
|
|
493
512
|
const bvalue = buf.readUB4();
|
|
494
513
|
if (bvalue > 0) { // Non Null data in column
|
|
495
514
|
colValue = new ThinLobImpl();
|
|
496
|
-
|
|
497
|
-
|
|
515
|
+
if (oraTypeNum === constants.TNS_DATA_TYPE_BFILE) {
|
|
516
|
+
buf.skipUB4();
|
|
517
|
+
} else {
|
|
518
|
+
length = buf.readUB8();
|
|
519
|
+
chunkSize = buf.readUB4();
|
|
520
|
+
}
|
|
498
521
|
const locator = Buffer.from(buf.readBytesWithLength());
|
|
499
522
|
colValue.init(this.connection, locator, dbType, length, chunkSize);
|
|
500
523
|
}
|
|
@@ -610,6 +633,7 @@ class MessageWithData extends Message {
|
|
|
610
633
|
if (variable.type === types.DB_TYPE_CLOB ||
|
|
611
634
|
variable.type === types.DB_TYPE_NCLOB ||
|
|
612
635
|
variable.type === types.DB_TYPE_BLOB ||
|
|
636
|
+
variable.type === types.DB_TYPE_BFILE ||
|
|
613
637
|
variable.type === types.DB_TYPE_JSON ||
|
|
614
638
|
variable.type === types.DB_TYPE_VECTOR) {
|
|
615
639
|
if (variable.type !== variable.fetchInfo.fetchType) {
|
|
@@ -691,7 +715,8 @@ class MessageWithData extends Message {
|
|
|
691
715
|
let contFlag = 0;
|
|
692
716
|
if (variable.type === types.DB_TYPE_BLOB ||
|
|
693
717
|
variable.type === types.DB_TYPE_CLOB ||
|
|
694
|
-
variable.type === types.DB_TYPE_NCLOB
|
|
718
|
+
variable.type === types.DB_TYPE_NCLOB ||
|
|
719
|
+
variable.type === types.DB_TYPE_BFILE) {
|
|
695
720
|
contFlag = constants.TNS_LOB_PREFETCH_FLAG;
|
|
696
721
|
} else if (variable.type === types.DB_TYPE_JSON) {
|
|
697
722
|
contFlag = constants.TNS_LOB_PREFETCH_FLAG;
|
|
@@ -843,7 +868,11 @@ class MessageWithData extends Message {
|
|
|
843
868
|
} else {
|
|
844
869
|
buf.writeUInt16BE(0x0100);
|
|
845
870
|
}
|
|
846
|
-
} else if (
|
|
871
|
+
} else if (
|
|
872
|
+
oraTypeNum === constants.TNS_DATA_TYPE_CLOB ||
|
|
873
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BLOB ||
|
|
874
|
+
oraTypeNum === constants.TNS_DATA_TYPE_BFILE
|
|
875
|
+
) {
|
|
847
876
|
buf.writeUB4(value._locator.length);
|
|
848
877
|
buf.writeBytesWithLength(value._locator);
|
|
849
878
|
} else if ([constants.TNS_DATA_TYPE_ROWID, constants.TNS_DATA_TYPE_UROWID].includes(oraTypeNum)) {
|
|
@@ -174,6 +174,10 @@ class Protocol {
|
|
|
174
174
|
if (callTimeoutExpired) {
|
|
175
175
|
errors.throwErr(errors.ERR_CALL_TIMEOUT_EXCEEDED, this.callTimeout);
|
|
176
176
|
}
|
|
177
|
+
if (message.retry) {
|
|
178
|
+
message.errorOccurred = false;
|
|
179
|
+
return await this._processMessage(message);
|
|
180
|
+
}
|
|
177
181
|
let err = new Error(message.errorInfo.message);
|
|
178
182
|
err.offset = message.errorInfo.pos;
|
|
179
183
|
err.errorNum = message.errorInfo.num;
|
|
@@ -301,7 +301,7 @@ class NetworkSession {
|
|
|
301
301
|
this.markerPkt = new Packet.MarkerPacket(this.sAtts.largeSDU);
|
|
302
302
|
this.controlPkt = new Packet.ControlPacket();
|
|
303
303
|
this.ntAdapter.largeSDU = this.sAtts.largeSDU;
|
|
304
|
-
this.sAtts.
|
|
304
|
+
this.sAtts.clearWallet();
|
|
305
305
|
this.sAtts.nt.walletPassword = null;
|
|
306
306
|
return (true);
|
|
307
307
|
}
|
|
@@ -328,6 +328,7 @@ class NetworkSession {
|
|
|
328
328
|
this.ntAdapter.disconnect(constants.NSFIMM);
|
|
329
329
|
this.ntAdapter = null;
|
|
330
330
|
}
|
|
331
|
+
this.sAtts.clearWallet();
|
|
331
332
|
connected = false;
|
|
332
333
|
savedErr = err;
|
|
333
334
|
try {
|
|
@@ -296,7 +296,9 @@ function RedirectPacket(packet) {
|
|
|
296
296
|
*/
|
|
297
297
|
function MarkerPacket(isLargeSDU) {
|
|
298
298
|
this.len = constants.NSPMKDAT + 1; /* Packet length */
|
|
299
|
-
|
|
299
|
+
|
|
300
|
+
// Packet Buffer
|
|
301
|
+
this.buf = Buffer.allocUnsafe(constants.NSPMKDAT + 1).fill(0);
|
|
300
302
|
|
|
301
303
|
if (isLargeSDU) {
|
|
302
304
|
this.buf.writeUInt32BE(this.len, constants.NSPHDLEN);
|