Skip to content

Commit fd5e32c

Browse files
committed
Fixed bug that may cause runtime issues in some JavaScript frameworks
1 parent d886a38 commit fd5e32c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

doc/src/release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Common Changes
2020
#) Fixed bug that may cause runtime issues in some JavaScript frameworks.
2121
See `Issue #1706 <https://github.com/oracle/node-oracledb/issues/1706>`__.
2222

23+
Thin Mode Changes
24+
+++++++++++++++++
25+
26+
#) Fixed bug that fails to throw an error, when fetching data greater
27+
than the ``maxSize`` property of outbinds in Oracle Database 12.1.
2328

2429
node-oracledb `v6.7.0 <https://github.com/oracle/node-oracledb/compare/v6.6.0...v6.7.0>`__ (18 Nov 2024)
2530
---------------------------------------------------------------------------------------------------------

lib/thin/protocol/messages/withData.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class MessageWithData extends Message {
698698
// conversion requested if maxSize is not multiplied by the
699699
// bufferSizeFactor
700700
if (variable.type._csfrm === constants.CSFRM_NCHAR) {
701-
maxSize *= variable.type._bufferSizeFactor;
701+
maxSize = Math.min(maxSize * variable.type._bufferSizeFactor, constants.TNS_MAX_LONG_LENGTH);
702702
}
703703
if ([constants.TNS_DATA_TYPE_ROWID, constants.TNS_DATA_TYPE_UROWID].includes(oraTypeNum)) {
704704
oraTypeNum = constants.TNS_DATA_TYPE_VARCHAR;
@@ -726,11 +726,9 @@ class MessageWithData extends Message {
726726
// expects that and complains if any other value is sent!
727727
buf.writeUInt8(0);
728728
buf.writeUInt8(0);
729-
if (maxSize > buf.caps.maxStringSize) {
730-
buf.writeUB4(constants.TNS_MAX_LONG_LENGTH);
731-
} else {
732-
buf.writeUB4(maxSize);
733-
}
729+
730+
// Write the max buffer size
731+
buf.writeUB4(maxSize);
734732

735733
if (variable.isArray) {
736734
buf.writeUB4(variable.maxArraySize);

0 commit comments

Comments
 (0)