summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/rename_collection.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-04-28 17:28:02 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2014-04-29 15:09:57 -0400
commitca3f2b297817fc6f1a535bd0281df7ecc3ba6979 (patch)
tree71ffefdce2d682b02102c6de68906c4fbcf1aa83 /src/mongo/db/commands/rename_collection.cpp
parentcf3d1dd725362dd098af038f99f7fb232e3210b3 (diff)
downloadmongo-ca3f2b297817fc6f1a535bd0281df7ecc3ba6979.tar.gz
SERVER-13084,SERVER-13632,SERVER-13634 Remove DiskLoc methods hitting disk
Diffstat (limited to 'src/mongo/db/commands/rename_collection.cpp')
-rw-r--r--src/mongo/db/commands/rename_collection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/commands/rename_collection.cpp b/src/mongo/db/commands/rename_collection.cpp
index 8c239e7e414..6a4e0bd6f89 100644
--- a/src/mongo/db/commands/rename_collection.cpp
+++ b/src/mongo/db/commands/rename_collection.cpp
@@ -234,10 +234,11 @@ namespace mongo {
// Copy over all the data from source collection to target collection.
bool insertSuccessful = true;
boost::scoped_ptr<RecordIterator> sourceIt;
+ Collection* sourceColl = NULL;
{
Client::Context srcCtx( source );
- Collection* sourceColl = srcCtx.db()->getCollection( source );
+ sourceColl = srcCtx.db()->getCollection( source );
sourceIt.reset( sourceColl->getIterator( DiskLoc(), false, CollectionScanParams::FORWARD ) );
}
@@ -246,7 +247,7 @@ namespace mongo {
BSONObj o;
{
Client::Context srcCtx( source );
- o = sourceIt->getNext().obj();
+ o = sourceColl->docFor(sourceIt->getNext());
}
// Insert and check return status of insert.
{
@@ -278,7 +279,6 @@ namespace mongo {
bool indexSuccessful = true;
{
Client::Context srcCtx( source );
- Collection* sourceColl = srcCtx.db()->getCollection( source );
IndexCatalog::IndexIterator sourceIndIt =
sourceColl->getIndexCatalog()->getIndexIterator( true );