Skip to content

Commit 4ae0a82

Browse files
committed
Fixed bug which throws ORA-22288 error in certain scenarios when querying BFILENAME() with outbinds
1 parent 0d18fa5 commit 4ae0a82

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

doc/src/release_notes.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ Thin Mode Changes
2121
See `Issue #1684 <https://github.com/oracle/node-oracledb/issues/
2222
1684>`__.
2323

24-
Thick Mode Changes
25-
+++++++++++++++++++
24+
Thick Mode changes
25+
++++++++++++++++++
26+
27+
#) Fixed bug which throws ``ORA-22288`` error in certain scenarios when
28+
querying ``BFILENAME()`` with outbinds.
2629

2730
node-oracledb `v6.6.0 <https://github.com/oracle/node-oracledb/compare/v6.5.1...v6.6.0>`__ (25 Jul 2024)
2831
---------------------------------------------------------------------------------------------------------

src/njsLob.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ bool njsLob_new(njsModuleGlobals *globals, njsLobBuffer *buffer, napi_env env,
315315
lob->chunkSize = buffer->chunkSize;
316316
lob->pieceSize = buffer->chunkSize;
317317
lob->length = buffer->length;
318+
if (lob->dataType == NJS_DATATYPE_BFILE) {
319+
lob->dirtyLength = true;
320+
}
318321

319322
// store a reference to the calling object on the LOB
320323
NJS_CHECK_NAPI(env, napi_set_named_property(env, *lobObj, "_parentObj",
@@ -336,10 +339,11 @@ bool njsLob_populateBuffer(njsBaton *baton, njsLobBuffer *buffer)
336339
if (buffer->dataType != DPI_ORACLE_TYPE_BFILE) {
337340
if (dpiLob_getChunkSize(buffer->handle, &buffer->chunkSize) < 0)
338341
return njsBaton_setErrorDPI(baton);
342+
343+
if (dpiLob_getSize(buffer->handle, &buffer->length) < 0)
344+
return njsBaton_setErrorDPI(baton);
339345
}
340346

341-
if (dpiLob_getSize(buffer->handle, &buffer->length) < 0)
342-
return njsBaton_setErrorDPI(baton);
343347
return true;
344348
}
345349

0 commit comments

Comments
 (0)