[SERVER-15490] Heap1BtreeImpl::ReverseCursor::advanceTo does not account for current position of cursor Created: 01/Oct/14  Updated: 02/Aug/18  Resolved: 20/Apr/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.7.6
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Unassigned
Resolution: Done Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-17635 Improve SortedDataInterface::Cursor API Closed
Participants:

 Description   

Relevant snipped of test case extracted below:

scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() );
scoped_ptr<SortedDataInterface> sorted( harnessHelper->newSortedDataInterface() );
 
scoped_ptr<OperationContext> opCtx( harnessHelper->newOperationContext() );
 
WriteUnitOfWork uow( opCtx.get() );
ASSERT_OK( sorted->insert( opCtx.get(), key1, loc1, false ) );
ASSERT_OK( sorted->insert( opCtx.get(), key1, loc2, true /* allow duplicates */ ) );
ASSERT_OK( sorted->insert( opCtx.get(), key1, loc3, true /* allow duplicates */ ) );
uow.commit();
 
scoped_ptr<SortedDataInterface::Cursor> cursor( sorted->newCursor( opCtx.get(), -1 ) );
cursor->locate( key1, loc2 );
 
vector<const BSONElement*> keyEnd( 1 );
vector<bool> keyEndInclusive( 1 );
 
cursor->advanceTo( key1, 1, false, keyEnd, keyEndInclusive );
ASSERT_EQUALS( key1, cursor->getKey() );
ASSERT_EQUALS( loc1, cursor->getDiskLoc() );

Instead, the cursor is positioned at (key1, loc3), i.e. the last occurrence of the specified key in the index.



 Comments   
Comment by Mathias Stearn [ 20/Apr/15 ]

No longer an issues after API changes from SERVER-17635.

Generated at Thu Feb 08 03:38:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.