-
Notifications
You must be signed in to change notification settings - Fork 43
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
error calculating remaining bytes when reading from text lob stored in value_image #188
Comments
Can you be a little more specific about what type of problem you encountered? I wrote the tests below which read from an Ion-text BLOB and a CLOB and did not encounter any issues. Would it be possible for you to modify one or both of these to reproduce the issue you're experiencing?
|
sure, my issue was that it wasn't reading the entire lob because the length was getting reduced each loop (using partial read) by more than what was read i.e. it was returning zero bytes read before it had actually finished I'll give your tests a check as soon as I can; however, at first glance I'm not sure if either would catch it though, because it only occurs when doing partial reads in a loop. |
yeah, neither of those tests trigger the code where I was having issues with. I made a quick modification that showcases the problem by reading the clob in chunks of 5 bytes using the read_lob_partial_bytes function;
|
Now that I can work with. Thanks. I'm digging further into it now. |
I ran into a problem trying to read an entire lob block after it had been loaded into the scanner value image from a previous get lob size call. I tracked down the issue to line 1925 in ion_reader_text.c where it updates the length of the remaining bytes.
The line currently reads:
__text->_scanner.value_image.length -= remaining;
but I think it should probably be setting the length to be equal to 'remaining' or just subtracting the bytes written.
It seems to work as I would expect with these changes in my local copy.
The text was updated successfully, but these errors were encountered: