Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,11 @@ void Connection::EIO_Execute(uv_work_t* req) {

if(stmt && rs) {
stmt->closeResultSet(rs);
rs = NULL;
}
if(stmt) {
baton->connection->m_connection->terminateStatement(stmt);
stmt = NULL;
}
}

Expand Down Expand Up @@ -490,7 +492,6 @@ Local<Object> Connection::CreateV8ObjectFromRow(std::vector<column_t*> columns,
uint32_t colIndex = 0;
for (std::vector<column_t*>::iterator iterator = columns.begin(), end = columns.end(); iterator != end; ++iterator, colIndex++) {
column_t* col = *iterator;
// printf("Column: %s\n", col->name.c_str());
void* val = currentRow->values[colIndex];
if(val == NULL) {
obj->Set(String::New(col->name.c_str()), Null());
Expand All @@ -514,12 +515,14 @@ Local<Object> Connection::CreateV8ObjectFromRow(std::vector<column_t*> columns,
{
oracle::occi::Date* v = (oracle::occi::Date*)val;
obj->Set(String::New(col->name.c_str()), OracleDateToV8Date(v));
delete v;
}
break;
case VALUE_TYPE_TIMESTAMP:
{
oracle::occi::Timestamp* v = (oracle::occi::Timestamp*)val;
obj->Set(String::New(col->name.c_str()), OracleTimestampToV8Date(v));
delete v;
}
break;
case VALUE_TYPE_CLOB:
Expand Down Expand Up @@ -550,7 +553,8 @@ Local<Object> Connection::CreateV8ObjectFromRow(std::vector<column_t*> columns,
v->closeStream(instream);
v->close();
obj->Set(String::New(col->name.c_str()), String::New(buffer, clobLength));
delete buffer;
delete v;
delete [] buffer;
}
break;
case VALUE_TYPE_BLOB:
Expand All @@ -572,7 +576,7 @@ Local<Object> Connection::CreateV8ObjectFromRow(std::vector<column_t*> columns,
v8::Handle<v8::Value> constructorArgs[3] = { nodeBuff->handle_, v8::Integer::New(blobLength), v8::Integer::New(0) };
v8::Local<v8::Object> v8Buffer = bufferConstructor->NewInstance(3, constructorArgs);
obj->Set(String::New(col->name.c_str()), v8Buffer);
delete buffer;
delete v;
break;
}
break;
Expand Down Expand Up @@ -600,6 +604,8 @@ Local<Array> Connection::CreateV8ArrayFromRows(std::vector<column_t*> columns, s
}

void Connection::EIO_AfterExecute(uv_work_t* req, int status) {

HandleScope scope;
ExecuteBaton* baton = static_cast<ExecuteBaton*>(req->data);

baton->connection->Unref();
Expand Down Expand Up @@ -654,7 +660,7 @@ void Connection::EIO_AfterExecute(uv_work_t* req, int status) {
output->clobVal.closeStream(instream);
output->clobVal.close();
obj->Set(String::New(returnParam.c_str()), String::New(buffer, lobLength));
delete buffer;
delete [] buffer;
break;
}
case OutParam::OCCIBLOB:
Expand All @@ -675,7 +681,6 @@ void Connection::EIO_AfterExecute(uv_work_t* req, int status) {
v8::Handle<v8::Value> constructorArgs[3] = { nodeBuff->handle_, v8::Integer::New(lobLength), v8::Integer::New(0) };
v8::Local<v8::Object> v8Buffer = bufferConstructor->NewInstance(3, constructorArgs);
obj->Set(String::New(returnParam.c_str()), v8Buffer);
delete buffer;
break;
}
case OutParam::OCCIDATE:
Expand Down
2 changes: 2 additions & 0 deletions src/executeBaton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ExecuteBaton::~ExecuteBaton() {
}

for (std::vector<value_t*>::iterator iterator = values.begin(), end = values.end(); iterator != end; ++iterator) {

value_t* val = *iterator;
if(val->type == VALUE_TYPE_STRING) {
delete (std::string*)val->value;
Expand All @@ -35,6 +36,7 @@ ExecuteBaton::~ExecuteBaton() {
row_t* currentRow = *iterator;
delete currentRow;
}

delete rows;
}

Expand Down