diff options
author | Martin Bligh <mbligh@mongodb.com> | 2015-10-21 13:25:24 -0400 |
---|---|---|
committer | Martin Bligh <mbligh@mongodb.com> | 2015-10-21 13:26:52 -0400 |
commit | a46d64143bae5b1e66b18cb13683d59d8d986e6b (patch) | |
tree | 73da57b8ad77f1b466f45e684f1d98fb56636e05 /src/mongo/db/dbhelpers.cpp | |
parent | f7f592e92b3146e20d311a35492116d7488e7e2b (diff) | |
download | mongo-a46d64143bae5b1e66b18cb13683d59d8d986e6b.tar.gz |
SERVER-21048: Stop regetting the collection in deleteObjects
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 8f970c8ca11..999a2c8250e 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -562,7 +562,8 @@ void Helpers::emptyCollection(OperationContext* txn, const char* ns) { bool shouldReplicateWrites = txn->writesAreReplicated(); txn->setReplicatedWrites(false); ON_BLOCK_EXIT(&OperationContext::setReplicatedWrites, txn, shouldReplicateWrites); - deleteObjects(txn, context.db(), ns, BSONObj(), PlanExecutor::YIELD_MANUAL, false); + Collection* collection = context.db() ? context.db()->getCollection(ns) : nullptr; + deleteObjects(txn, collection, ns, BSONObj(), PlanExecutor::YIELD_MANUAL, false); } Helpers::RemoveSaver::RemoveSaver(const string& a, const string& b, const string& why) { |