-
Notifications
You must be signed in to change notification settings - Fork 652
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
Cursor.Prev() out of range issue v1.3.9 #733
Labels
Comments
Thanks @axww for raising this issue. It's a minor issue. Usually when you have already reached the beginning, you should call But I agree that users should be able to call |
Open to track the backport effort |
Done. |
The fix will be included in 1.3.10 |
ahrtr
added a commit
to openkvlab/boltdb
that referenced
this issue
Jul 23, 2024
… by call Next when it has already reached the beginning Refer to etcd-io/bbolt#733 Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I met an issue during dev. Here's my sample code:
The output of the program:
As you can see I put 3 rows "1", "2" and "3" into the bucket.
Both of "Next test" and "Prev test", I set cursor at "2" initially.
In "Next test", I move cursor to "3", then run Next() again, it returns nil.
Then I run Prev(), the cursor targets to "2".
In "Prev test", I move cursor to "1", then run Prev() again, it returns nil.
Then I run Next(), the cursor targets to nil.
Whatever how many Next() I added in "Prev test", the cursor still targes to nil.
It seems after Cursor.Prev() out of range, it stucks there and can not be use anymore.
I don't know if this is a bug or a correct design, but it's strange.
Do you consider make these 2 situations have similiar behavior?
Thank you very much!
Best
The text was updated successfully, but these errors were encountered: