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: improper relative cursor movement #1462

Merged

Conversation

@nicktorwald
Copy link
Contributor

@nicktorwald nicktorwald commented Apr 8, 2019

Fix a wrong relative cursor movement when a new calculated index is
negative (beyond the first row). According to the java-doc, in this
case the position leaves before the first row. Current implementation
of the 'relative' method delegates the movement to the 'absolute' method
which treats a negative index with respect to the end of the result set.

Example: assume we have next result set {1, 2, *3, 4, 5, 6} and we are
on the 3rd position. Move relative to -6 which means a new index is
-3 (3 - 6). I expect the result set will be on the zero position with
before-first status but actually we are on the 4th position (3rd from the end).

Fix a wrong relative cursor movement when a new calculated index is
negative (beyond the first row). According to the java-doc, in this
case the position leaves before the first row. Current implementation
of the 'relative' method delegates the movement to the 'absolute' method
which treats a negative index with respect to the end of the result set.
@AppVeyorBot
Copy link

@AppVeyorBot AppVeyorBot commented Apr 8, 2019

@codecov-io
Copy link

@codecov-io codecov-io commented Apr 8, 2019

Codecov Report

Merging #1462 into master will increase coverage by 0.04%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##             master    #1462      +/-   ##
============================================
+ Coverage     68.74%   68.79%   +0.04%     
- Complexity     3903     3906       +3     
============================================
  Files           179      179              
  Lines         16414    16418       +4     
  Branches       2672     2673       +1     
============================================
+ Hits          11284    11294      +10     
+ Misses         3883     3879       -4     
+ Partials       1247     1245       -2

@davecramer davecramer merged commit b6ab27c into pgjdbc:master Apr 8, 2019
3 checks passed
@nicktorwald nicktorwald deleted the nicktorwald/result-set-relative branch Apr 8, 2019
davecramer added a commit to davecramer/pgjdbc that referenced this issue Jul 5, 2021
Fix a wrong relative cursor movement when a new calculated index is
negative (beyond the first row). According to the java-doc, in this
case the position leaves before the first row. Current implementation
of the 'relative' method delegates the movement to the 'absolute' method
which treats a negative index with respect to the end of the result set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants