Skip to content
Browse files

Corrected error: ORA-32114: Cannot perform operation on a null LOB

  • Loading branch information...
1 parent e3c2a2e commit b592b3c574b7d808ded9ac95e339efde01418adc @tojocky committed May 3, 2012
Showing with 12 additions and 7 deletions.
  1. +12 −7 src/result.cc
View
19 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) {

0 comments on commit b592b3c

Please sign in to comment.
Something went wrong with that request. Please try again.