Skip to content

Commit

Permalink
Corrected error: ORA-32114: Cannot perform operation on a null LOB
Browse files Browse the repository at this point in the history
  • Loading branch information
tojocky committed May 3, 2012
1 parent e3c2a2e commit b592b3c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/result.cc
Expand Up @@ -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) {
Expand Down

0 comments on commit b592b3c

Please sign in to comment.