From b592b3c574b7d808ded9ac95e339efde01418adc Mon Sep 17 00:00:00 2001 From: Ion Date: Thu, 3 May 2012 12:19:02 +0300 Subject: [PATCH] Corrected error: ORA-32114: Cannot perform operation on a null LOB --- src/result.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/result.cc b/src/result.cc index 73ada85..6c08652 100644 --- a/src/result.cc +++ b/src/result.cc @@ -204,15 +204,20 @@ char** node_db_oracle::Result::row(unsigned long* rowColumnLengths) throw(node_d for (c=0; c < this->totalColumns; c++) { if (this->columns[c]->isBinary()) { - oracle::occi::Blob blob = this->resultSet->getBlob(c + 1); - rowColumnLengths[c] = blob.length(); + if(!this->resultSet->isNull(c + 1)){ + oracle::occi::Blob blob = this->resultSet->getBlob(c + 1); + rowColumnLengths[c] = blob.length(); - row[c] = new char[rowColumnLengths[c]]; - if (row[c] == NULL) { - throw node_db::Exception("Could not allocate buffer for row column"); - } + row[c] = new char[rowColumnLengths[c]]; + if (row[c] == NULL) { + throw node_db::Exception("Could not allocate buffer for row column"); + } - blob.read(rowColumnLengths[c], (unsigned char*) row[c], rowColumnLengths[c]); + blob.read(rowColumnLengths[c], (unsigned char*) row[c], rowColumnLengths[c]); + }else{ + rowColumnLengths[c] = 0; + row[c] = new char[0]; + } } else { std::string string; if (this->columns[c]->getType() == Column::DATETIME) {