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
CursorIterable/KeyRange broken in v0.9.0 #228
Comments
I can confirm as well that the |
Could you maybe try with #237? |
The changes in v0.9.0 have broken CursorIterable for some KeyRange types and keys. I noticed the problem when using
KeyRange.atLeastBackward(
. The cursor was starting on the wrong key.I think the problem is this line:
lmdbjava-0.8.3...lmdbjava-0.9.0#diff-a5dda1cdb60b45d45a5a4364768ad1f7c62ac0ec025f295f78d489cf08392bf2R206
It is using the standard java
ByteBuffer.compareTo
method rather than your lexographicalAbstractByteBufferProxy::compareBuff
method, so 150 is considered < 110.See my branch (on the link below) where I have changed your
CursorIterableTest
to use 200 ... 900 instead of 2 ... 9 for the key values to demonstrate the problem. With the modified values a lot of the tests fail. ChangingAbstractByteBufferProxy
to usecompareBuf
makes them all pass again.https://github.com/lmdbjava/lmdbjava/compare/master...at055612:backwards-at-least?expand=1
I think this is the problem is in
AbstractByteBufferProxy
.It may also be an issue for netty/agrona but I am not using those so have not looked.
This is a pretty serious bug for anyone using KeyRanges and it will present in subtle ways depending on the keys in the db and the keyRange type used.
The text was updated successfully, but these errors were encountered: