summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2014-04-17 12:13:59 -0400
committerEliot Horowitz <eliot@10gen.com>2014-04-17 13:14:04 -0400
commit03a7be273f670f01f3c510e43464d7ecd1ce2173 (patch)
treedf3b65ce9a85e7afbe63506851cc8e8bd1efca69 /src/mongo/db/ops
parent92748f2572fd6492bfccd56e339b7255017d15ee (diff)
downloadmongo-03a7be273f670f01f3c510e43464d7ecd1ce2173.tar.gz
SERVER-13084: remove Client::database and make many things not use thread local versions
Diffstat (limited to 'src/mongo/db/ops')
-rw-r--r--src/mongo/db/ops/delete_executor.cpp8
-rw-r--r--src/mongo/db/ops/update.cpp9
2 files changed, 10 insertions, 7 deletions
diff --git a/src/mongo/db/ops/delete_executor.cpp b/src/mongo/db/ops/delete_executor.cpp
index c5afe38374a..a7007e8df2c 100644
--- a/src/mongo/db/ops/delete_executor.cpp
+++ b/src/mongo/db/ops/delete_executor.cpp
@@ -101,12 +101,14 @@ namespace mongo {
}
}
+ Database* db = currentClient.get()->getContext()->db();
+
massert(17418,
mongoutils::str::stream() <<
- "dbname = " << currentClient.get()->database()->name() <<
+ "dbname = " << db->name() <<
"; ns = " << ns.ns(),
- currentClient.get()->database()->name() == nsToDatabaseSubstring(ns.ns()));
- Collection* collection = currentClient.get()->database()->getCollection(ns.ns());
+ db->name() == nsToDatabaseSubstring(ns.ns()));
+ Collection* collection = db->getCollection(ns.ns());
if (NULL == collection) {
return 0;
}
diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp
index 8bdb532e860..50ff3a30379 100644
--- a/src/mongo/db/ops/update.cpp
+++ b/src/mongo/db/ops/update.cpp
@@ -405,7 +405,7 @@ namespace mongo {
}
Collection* oldCollection = collection;
- collection = cc().database()->getCollection(nsString.ns());
+ collection = cc().getContext()->db()->getCollection(nsString.ns());
// We should not get a new pointer to the same collection...
if (oldCollection && (oldCollection != collection))
@@ -500,7 +500,7 @@ namespace mongo {
const NamespaceString& nsString = request.getNamespaceString();
UpdateLifecycle* lifecycle = request.getLifecycle();
const CurOp* curOp = cc().curop();
- Collection* collection = cc().database()->getCollection(nsString.ns());
+ Collection* collection = cc().getContext()->db()->getCollection(nsString.ns());
validateUpdate(nsString.ns().c_str(), request.getUpdates(), request.getQuery());
@@ -874,9 +874,10 @@ namespace mongo {
// Only create the collection if the doc will be inserted.
if (!collection) {
- collection = cc().database()->getCollection(request.getNamespaceString().ns());
+ Database* db = cc().getContext()->db();
+ collection = db->getCollection(request.getNamespaceString().ns());
if (!collection) {
- collection = cc().database()->createCollection(request.getNamespaceString().ns());
+ collection = db->createCollection(request.getNamespaceString().ns());
}
}