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

fix: wrong data from Blob/Clob when mark/reset is used #971

Merged
merged 6 commits into from
Mar 11, 2018
Merged

fix: wrong data from Blob/Clob when mark/reset is used #971

merged 6 commits into from
Mar 11, 2018

Conversation

sfeigl
Copy link
Contributor

@sfeigl sfeigl commented Sep 30, 2017

Hi,

I spotted an incorrect behaviour using LargeObject BlobInputStream mark() and reset() methods.

Both methods do not take the internal buffer in account.

  • mark() actually marks the position after the last byte in the buffer
  • reset() changes the large object position, but does not clear the buffer. Buffered bytes from the old position are still returned after reset() until the buffer is depleted.

Here is a suggested fix. The reset() method could be more sophisticated by checking wheter parts of the buffer could be reused.

@codecov-io
Copy link

codecov-io commented Sep 30, 2017

Codecov Report

Merging #971 into master will increase coverage by 0.03%.
The diff coverage is 71.42%.

@@             Coverage Diff              @@
##             master     #971      +/-   ##
============================================
+ Coverage     67.38%   67.42%   +0.03%     
- Complexity     3687     3689       +2     
============================================
  Files           170      170              
  Lines         15638    15640       +2     
  Branches       2531     2532       +1     
============================================
+ Hits          10538    10545       +7     
+ Misses         3917     3911       -6     
- Partials       1183     1184       +1

@vlsi vlsi changed the title Bug blob mark fix: wrong data from Blob/Clob when mark/reset is used Mar 10, 2018
@vlsi vlsi merged commit 61e1c30 into pgjdbc:master Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants