Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-3070

Fix search_near() for index cursor

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • WT2.9.0
    • WT2.9.1, 3.2.12, 3.4.2, 3.5.2
    • None
    • None

    Description

      Hi, I see strange behaviour of search_near() function after switching on 2.9.0, output of attached test builded with 2.9.0:

      $ LD_LIBRARY_PATH=wt_290/.libs/ ./search_near
      key = 10, search_near_key = 1, exact = -1, expected_exact = 1
      key = 15, search_near_key = 11, exact = -1, expected_exact = 1
      key = 15, search_near_key = 15, exact = 0, expected_exact = 0
      key = 20, search_near_key = 19, exact = -1, expected_exact = 1
      cursor->search_near(cursor, &exact) at (search_near.c:57) failed: WT_NOTFOUND: item not found [-31803]
      

      with 2.8.0:

      $ LD_LIBRARY_PATH=wt_280/.libs/ ./search_near
      key = 10, search_near_key = 1, exact = 1, expected_exact = 1
      key = 15, search_near_key = 11, exact = 1, expected_exact = 1
      key = 15, search_near_key = 15, exact = 1, expected_exact = 0
      key = 20, search_near_key = 19, exact = 1, expected_exact = 1
      key = 20, search_near_key = 21, exact = -1, expected_exact = -1
      

      I once again checked function documentation, it seems attached test should works. Also strange that for 2.8.0 in my test exact = 1 when it should be 0:

      key = 15, search_near_key = 15, exact = 1, expected_exact = 0
      

      Can you please have a look, probably I missing something?

      Attachments

        Issue Links

          Activity

            People

              michael.cahill@mongodb.com Michael Cahill
              Denis Shkirya Denis Shkirya
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: