summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-12-09 16:21:46 -0500
committerJames Wahlin <james.wahlin@10gen.com>2016-12-12 09:24:19 -0500
commit5f353871bad67ea8093a73df725ffe094b5ac7b8 (patch)
treeebdb259dddd853fd1b71a9374fcfe18e9de8f302
parent21a6f07d859c132154166bd3d83bbed238d5d719 (diff)
downloadmongo-5f353871bad67ea8093a73df725ffe094b5ac7b8.tar.gz
SERVER-27307 Store DocumentSourceCursor namespace as NamespaceString
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.cpp8
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.h3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp
index 0ee8332c9bc..0936f6291fe 100644
--- a/src/mongo/db/pipeline/document_source_cursor.cpp
+++ b/src/mongo/db/pipeline/document_source_cursor.cpp
@@ -87,8 +87,7 @@ void DocumentSourceCursor::loadBatch() {
// We have already validated the sharding version when we constructed the PlanExecutor
// so we shouldn't check it again.
- const NamespaceString nss(_ns);
- AutoGetCollectionForRead autoColl(pExpCtx->opCtx, nss);
+ AutoGetCollectionForRead autoColl(pExpCtx->opCtx, _nss);
_exec->restoreState();
@@ -192,8 +191,7 @@ Value DocumentSourceCursor::serialize(bool explain) const {
// Get planner-level explain info from the underlying PlanExecutor.
BSONObjBuilder explainBuilder;
{
- const NamespaceString nss(_ns);
- AutoGetCollectionForRead autoColl(pExpCtx->opCtx, nss);
+ AutoGetCollectionForRead autoColl(pExpCtx->opCtx, _nss);
massert(17392, "No _exec. Were we disposed before explained?", _exec);
@@ -247,7 +245,7 @@ DocumentSourceCursor::DocumentSourceCursor(const string& ns,
const intrusive_ptr<ExpressionContext>& pCtx)
: DocumentSource(pCtx),
_docsAddedToBatches(0),
- _ns(ns),
+ _nss(ns),
_exec(std::move(exec)),
_outputSorts(_exec->getOutputSorts()) {
recordPlanSummaryStr();
diff --git a/src/mongo/db/pipeline/document_source_cursor.h b/src/mongo/db/pipeline/document_source_cursor.h
index 4d2cb1a81df..ebbf9eff64d 100644
--- a/src/mongo/db/pipeline/document_source_cursor.h
+++ b/src/mongo/db/pipeline/document_source_cursor.h
@@ -30,6 +30,7 @@
#include <deque>
+#include "mongo/db/namespace_string.h"
#include "mongo/db/pipeline/document_source.h"
#include "mongo/db/pipeline/document_source_limit.h"
#include "mongo/db/query/plan_summary_stats.h"
@@ -156,7 +157,7 @@ private:
boost::intrusive_ptr<DocumentSourceLimit> _limit;
long long _docsAddedToBatches; // for _limit enforcement
- const std::string _ns;
+ const NamespaceString _nss;
std::unique_ptr<PlanExecutor> _exec;
BSONObjSet _outputSorts;
std::string _planSummary;