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

Fix search_near() for index cursor

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.1, 3.2.12, 3.4.2, 3.5.2
    • Affects Version/s: WT2.9.0
    • Component/s: None
    • None

      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?

        1. search_near.c
          2 kB
          Denis Shkirya

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

              Created:
              Updated:
              Resolved: