Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made changes with OutParam::OCCICLOB bacause of problems with output cirillic chars #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/connection.cpp
Expand Up @@ -795,12 +795,13 @@ void Connection::handleResult(ExecuteBaton* baton, Handle<Value> (&argv)[2]) {
output->clobVal.open(oracle::occi::OCCI_LOB_READONLY);
oracle::occi::Stream* instream = output->clobVal.getStream(1,0);
size_t chunkSize = output->clobVal.getChunkSize();
char *buffer = new char[chunkSize];
char *buffer = new char[chunkSize + 1];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not enough size

memset(buffer, 0, chunkSize);
std::string clobVal;
int numBytesRead = instream->readBuffer(buffer, chunkSize);
int totalBytesRead = 0;
while (numBytesRead != -1) {
buffer[numBytesRead] = 0;
totalBytesRead += numBytesRead;
clobVal.append(buffer);
numBytesRead = instream->readBuffer(buffer, chunkSize);
Expand Down