Skip to content

Commit

Permalink
Small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
mariano committed Oct 3, 2011
1 parent 508487a commit 1d7d4df
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/result.cc
Expand Up @@ -217,19 +217,18 @@ char** node_db_oracle::Result::row(unsigned long* rowColumnLengths) throw(node_d
std::string string;
if (this->columns[c]->getType() == Column::DATETIME) {
oracle::occi::Date date = this->resultSet->getDate(c + 1);
if (!date.isNull())
string = date.toText("YYYY-MM-DD HH:II:SS");
if (date.isNull()) {
rowColumnLengths[c] = 0;
row[c] = NULL;
continue;
}

string = date.toText("YYYY-MM-DD HH:II:SS");
} else {
string = this->resultSet->getString(c + 1);
}

rowColumnLengths[c] = string.length();
if (rowColumnLengths[c] == 0) {
row[c] = NULL;
continue;
}

row[c] = new char[rowColumnLengths[c]];
if (row[c] == NULL) {
throw node_db::Exception("Could not allocate buffer for row column");
Expand Down

0 comments on commit 1d7d4df

Please sign in to comment.