Skip to content

Commit 641580d

Browse files
committed
Fixed a crash when selecting multiple rows with LOB values. Another patch by @bjouhier
1 parent 0ea4a31 commit 641580d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## node-oracledb v1.2.0 (DD Mon YYYY)
44

5+
- Fixed a crash when selecting multiple rows with LOB values.
6+
57
- Added a check to return an NJS error when an invalid DML RETURN statement
68
does not give an ORA error.
79

src/njs/src/njsResultSet.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,24 @@ void ResultSet::Async_GetRows(uv_work_t *req)
434434
njsRS->fetchRowCount_ = getRowsBaton->numRows;
435435
njsRS->defineBuffers_ = ebaton->defines;
436436
}
437+
else
438+
{
439+
for (unsigned int col = 0; col < njsRS->numCols_; col++)
440+
{
441+
switch(njsRS->meta_[col].dbType)
442+
{
443+
case dpi::DpiClob:
444+
case dpi::DpiBlob:
445+
case dpi::DpiBfile:
446+
for (unsigned int j = 0; j < ebaton->maxRows; j++)
447+
{
448+
((Descriptor **)(njsRS->defineBuffers_[col].buf))[j] =
449+
ebaton->dpienv->allocDescriptor(LobDescriptorType);
450+
}
451+
break;
452+
}
453+
}
454+
}
437455
ebaton->defines = njsRS->defineBuffers_;
438456
Connection::DoFetch(ebaton);
439457

0 commit comments

Comments
 (0)