Skip to content

Commit

Permalink
Merge pull request #35 from tojocky/patch-2
Browse files Browse the repository at this point in the history
Corrected error: ORA-32114: Cannot perform operation on a null LOB
  • Loading branch information
mariano committed May 3, 2012
2 parents e3c2a2e + b592b3c commit 226224a
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++) { for (c=0; c < this->totalColumns; c++) {
if (this->columns[c]->isBinary()) { if (this->columns[c]->isBinary()) {
oracle::occi::Blob blob = this->resultSet->getBlob(c + 1); if(!this->resultSet->isNull(c + 1)){
rowColumnLengths[c] = blob.length(); oracle::occi::Blob blob = this->resultSet->getBlob(c + 1);
rowColumnLengths[c] = blob.length();


row[c] = new char[rowColumnLengths[c]]; row[c] = new char[rowColumnLengths[c]];
if (row[c] == NULL) { if (row[c] == NULL) {
throw node_db::Exception("Could not allocate buffer for row column"); 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 { } else {
std::string string; std::string string;
if (this->columns[c]->getType() == Column::DATETIME) { if (this->columns[c]->getType() == Column::DATETIME) {
Expand Down

0 comments on commit 226224a

Please sign in to comment.