GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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 #86

New issue
Copy link
New issue
Copy link
Closed
Closed
KeyRange.atLeast vs KeyRange.atLeastBackward with out-of-bound value#86
Copy link

Description

@creambun
creambun
opened on Apr 15, 2018
Issue body actions

Hi 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

Activity

  1. bp-alex commented on Apr 18, 2018

    @bp-alex
    bp-alex
    on Apr 18, 2018
    Member
    More actions

    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.

  2. creambun commented on Apr 20, 2018

    @creambun
    creambun
    on Apr 20, 2018
    Author
    More actions

    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

  3. bp-alex commented on Apr 20, 2018

    @bp-alex
    bp-alex
    on Apr 20, 2018
    Member
    More actions

    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.

  4. bp-alex
    closed this as completedon Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.