diff options
author | Mathias Stearn <mathias@10gen.com> | 2015-03-17 13:39:24 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2015-03-19 17:39:33 -0400 |
commit | a2d60db504950f99ce96ec3b8bdfa6b5e165dc01 (patch) | |
tree | 4c159048e48bd139fb94bb5f6ffa7381cc747975 /src/mongo/db/dbhelpers.cpp | |
parent | af9ecc763ee0965a82cf481fb3be81c8a8aed704 (diff) | |
download | mongo-a2d60db504950f99ce96ec3b8bdfa6b5e165dc01.tar.gz |
SERVER-17623 Fix direct users of BtreeBasedAccessMethod and BtreeIndexCursor
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 92f82960e3e..0f7b403cefd 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -182,11 +182,7 @@ namespace mongo { if ( indexFound ) *indexFound = 1; - // See SERVER-12397. This may not always be true. - BtreeBasedAccessMethod* accessMethod = - static_cast<BtreeBasedAccessMethod*>(catalog->getIndex( desc )); - - RecordId loc = accessMethod->findSingle( txn, query["_id"].wrap() ); + RecordId loc = catalog->getIndex(desc)->findSingle( txn, query["_id"].wrap() ); if ( loc.isNull() ) return false; result = collection->docFor(txn, loc).value(); @@ -200,10 +196,7 @@ namespace mongo { IndexCatalog* catalog = collection->getIndexCatalog(); const IndexDescriptor* desc = catalog->findIdIndex( txn ); uassert(13430, "no _id index", desc); - // See SERVER-12397. This may not always be true. - BtreeBasedAccessMethod* accessMethod = - static_cast<BtreeBasedAccessMethod*>(catalog->getIndex( desc )); - return accessMethod->findSingle( txn, idquery["_id"].wrap() ); + return catalog->getIndex(desc)->findSingle( txn, idquery["_id"].wrap() ); } /* Get the first object from a collection. Generally only useful if the collection |