GeezerVison is showing github.com — KeyRange.atLeast vs KeyRange.atLeastBackward with out-of-bound value · Issue #86 · lmdbjava/lmdbjava
KeyRange.atLeast vs KeyRange.atLeastBackward with out-of-bound value #86DescriptionHi there,
I am not sure if the behavior described below is as expected because I cannot yet find relevant document. If there is, please kindly let me know
The behavior I found is that KeyRange.atLeast can iterate over all records even if the given key range value is smaller than the key of the first record, while KeyRange.atLeastBackward cannot even iterate one record if the given key range value is greater than the key of the last record. It is best illustrated below:
Data in db: {2, "22"}, {4, "44"}, {6, "66"}, {8, "88"}
Search with KeyRange.atLeast and start with key = 1 -> all records can be iterated. I have no question about this
Search with KeyRange.atLeast and start with key = 2 -> all records can also be iterated. I have no question about this
Search with KeyRange.atLeastBackward and start with key = 8 -> all record can be iterated backward. I have no question about this either
Search with KeyRange.atLeastBackward and start with key = 9 -> no record can be iterated. I am quite surprised
Can anyone please give me some hint / help? Thanks
JUnit test code can be found in the attached file test.zip
test.zip Activitybp-alex commented on Apr 18, 2018 This was reported in ticket #72 and fixed in commit 86083a2.
I just tried your test against trunk and it reports:
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running test.AtLeastBackwardTest
Forward iteration starting with key = 1 (smaller than smallest key)
Key: [2], value: [22]
Key: [4], value: [44]
Key: [6], value: [66]
Key: [8], value: [88]
Backward iteration starting with key = 9 (larger than largest key)
========================
note that if the key is larger than the last index, key range at least backward would not work
========================
Key: [8], value: [88]
Key: [6], value: [66]
Key: [4], value: [44]
Key: [2], value: [22]
Test done
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.305 s - in test.AtLeastBackwardTest
Results:
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
Would you confirming with 0.6.1-SNAPSHOT? This is available from the OSS Sonatype Repo. creambun commented on Apr 20, 2018 Thanks Ben Alex. The test passes in 0.6.1-SNAPSHOT. I didn't realize it is already fixed in 0.6.1-SNAPHOT. I was using 0.6.0 before
Sorry for inconvenience. Is 0.6.1 going out soon? Also, should I just close this issue here? Thanks bp-alex commented on Apr 20, 2018 Thanks for confirming the test passes with 0.6.1-SNAPSHOT.
I will release 0.6.1 properly within the next few days. Please watch issue #73 for updates. The main outstanding task is updating the LMDB C version, although I am also likely to update some build plugin versions as well for unrelated reasons.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|