summaryrefslogtreecommitdiff
path: root/src/mongo/db/query
diff options
context:
space:
mode:
authorADAM David Alan Martin <adam.martin@10gen.com>2019-06-10 01:21:01 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-06-10 01:59:35 -0400
commitc36f9ecb91e49da7e637863889804fc4e6c6c05e (patch)
tree64d8aadb6d29042d4f4e7366bc1457e4e0612383 /src/mongo/db/query
parentc9548e729c8fecd9d7a9a5dd341da0433194ac73 (diff)
downloadmongo-c36f9ecb91e49da7e637863889804fc4e6c6c05e.tar.gz
SERVER-39339 Remove `stdx/memory.h`
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r--src/mongo/db/query/canonical_query.cpp2
-rw-r--r--src/mongo/db/query/canonical_query_encoder_test.cpp2
-rw-r--r--src/mongo/db/query/canonical_query_test.cpp14
-rw-r--r--src/mongo/db/query/collation/collation_index_key.cpp2
-rw-r--r--src/mongo/db/query/collation/collator_factory_icu.cpp7
-rw-r--r--src/mongo/db/query/collation/collator_factory_icu_decoration.cpp5
-rw-r--r--src/mongo/db/query/collation/collator_factory_icu_test.cpp3
-rw-r--r--src/mongo/db/query/collation/collator_factory_mock.cpp5
-rw-r--r--src/mongo/db/query/collation/collator_interface_icu.cpp5
-rw-r--r--src/mongo/db/query/collation/collator_interface_mock.cpp4
-rw-r--r--src/mongo/db/query/datetime/date_time_support.cpp1
-rw-r--r--src/mongo/db/query/datetime/init_timezone_data.cpp7
-rw-r--r--src/mongo/db/query/find.cpp4
-rw-r--r--src/mongo/db/query/get_executor.cpp112
-rw-r--r--src/mongo/db/query/get_executor_test.cpp2
-rw-r--r--src/mongo/db/query/index_tag.cpp2
-rw-r--r--src/mongo/db/query/index_tag.h2
-rw-r--r--src/mongo/db/query/internal_plans.cpp29
-rw-r--r--src/mongo/db/query/parsed_distinct.cpp5
-rw-r--r--src/mongo/db/query/plan_cache.cpp4
-rw-r--r--src/mongo/db/query/plan_cache_indexability.cpp3
-rw-r--r--src/mongo/db/query/plan_cache_test.cpp16
-rw-r--r--src/mongo/db/query/plan_enumerator.cpp2
-rw-r--r--src/mongo/db/query/plan_executor_impl.cpp9
-rw-r--r--src/mongo/db/query/planner_access.cpp44
-rw-r--r--src/mongo/db/query/planner_access.h2
-rw-r--r--src/mongo/db/query/planner_analysis_test.cpp4
-rw-r--r--src/mongo/db/query/query_planner.cpp6
-rw-r--r--src/mongo/db/query/query_planner_test.cpp6
-rw-r--r--src/mongo/db/query/query_planner_test_fixture.cpp4
-rw-r--r--src/mongo/db/query/query_request.cpp11
-rw-r--r--src/mongo/db/query/query_solution_test.cpp21
-rw-r--r--src/mongo/db/query/query_test_service_context.cpp5
-rw-r--r--src/mongo/db/query/stage_builder.cpp12
34 files changed, 186 insertions, 176 deletions
diff --git a/src/mongo/db/query/canonical_query.cpp b/src/mongo/db/query/canonical_query.cpp
index ff77f314fa2..cba8c2e2736 100644
--- a/src/mongo/db/query/canonical_query.cpp
+++ b/src/mongo/db/query/canonical_query.cpp
@@ -184,7 +184,7 @@ StatusWith<std::unique_ptr<CanonicalQuery>> CanonicalQuery::canonicalize(
// static
StatusWith<std::unique_ptr<CanonicalQuery>> CanonicalQuery::canonicalize(
OperationContext* opCtx, const CanonicalQuery& baseQuery, MatchExpression* root) {
- auto qr = stdx::make_unique<QueryRequest>(baseQuery.nss());
+ auto qr = std::make_unique<QueryRequest>(baseQuery.nss());
BSONObjBuilder builder;
root->serialize(&builder);
qr->setFilter(builder.obj());
diff --git a/src/mongo/db/query/canonical_query_encoder_test.cpp b/src/mongo/db/query/canonical_query_encoder_test.cpp
index 672336e090b..4086f64402f 100644
--- a/src/mongo/db/query/canonical_query_encoder_test.cpp
+++ b/src/mongo/db/query/canonical_query_encoder_test.cpp
@@ -55,7 +55,7 @@ unique_ptr<CanonicalQuery> canonicalize(BSONObj query,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(query);
qr->setSort(sort);
qr->setProj(proj);
diff --git a/src/mongo/db/query/canonical_query_test.cpp b/src/mongo/db/query/canonical_query_test.cpp
index 8926ce0dd2d..a9517301859 100644
--- a/src/mongo/db/query/canonical_query_test.cpp
+++ b/src/mongo/db/query/canonical_query_test.cpp
@@ -182,7 +182,7 @@ unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson(queryStr));
auto statusWithCQ = CanonicalQuery::canonicalize(
@@ -198,7 +198,7 @@ std::unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson(queryStr));
qr->setSort(fromjson(sortStr));
qr->setProj(fromjson(projStr));
@@ -290,7 +290,7 @@ TEST(CanonicalQueryTest, CanonicalQueryFromQRWithNoCollation) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
auto cq = assertGet(CanonicalQuery::canonicalize(opCtx.get(), std::move(qr)));
ASSERT_TRUE(cq->getCollator() == nullptr);
}
@@ -299,7 +299,7 @@ TEST(CanonicalQueryTest, CanonicalQueryFromQRWithCollation) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setCollation(BSON("locale"
<< "reverse"));
auto cq = assertGet(CanonicalQuery::canonicalize(opCtx.get(), std::move(qr)));
@@ -311,7 +311,7 @@ TEST(CanonicalQueryTest, CanonicalQueryFromBaseQueryWithNoCollation) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson("{$or:[{a:1,b:1},{a:1,c:1}]}"));
auto baseCq = assertGet(CanonicalQuery::canonicalize(opCtx.get(), std::move(qr)));
MatchExpression* firstClauseExpr = baseCq->root()->getChild(0);
@@ -324,7 +324,7 @@ TEST(CanonicalQueryTest, CanonicalQueryFromBaseQueryWithCollation) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson("{$or:[{a:1,b:1},{a:1,c:1}]}"));
qr->setCollation(BSON("locale"
<< "reverse"));
@@ -340,7 +340,7 @@ TEST(CanonicalQueryTest, SettingCollatorUpdatesCollatorAndMatchExpression) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson("{a: 'foo', b: {$in: ['bar', 'baz']}}"));
auto cq = assertGet(CanonicalQuery::canonicalize(opCtx.get(), std::move(qr)));
ASSERT_EQUALS(2U, cq->root()->numChildren());
diff --git a/src/mongo/db/query/collation/collation_index_key.cpp b/src/mongo/db/query/collation/collation_index_key.cpp
index 3af408e8abd..48d971d3f7e 100644
--- a/src/mongo/db/query/collation/collation_index_key.cpp
+++ b/src/mongo/db/query/collation/collation_index_key.cpp
@@ -31,13 +31,13 @@
#include "mongo/db/query/collation/collation_index_key.h"
+#include <memory>
#include <stack>
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/util/builder.h"
#include "mongo/db/query/collation/collator_interface.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
namespace mongo {
diff --git a/src/mongo/db/query/collation/collator_factory_icu.cpp b/src/mongo/db/query/collation/collator_factory_icu.cpp
index c8b8de7a5ab..f9662b0a22a 100644
--- a/src/mongo/db/query/collation/collator_factory_icu.cpp
+++ b/src/mongo/db/query/collation/collator_factory_icu.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/query/collation/collator_factory_icu.h"
+#include <memory>
+
#include <unicode/coll.h>
#include <unicode/errorcode.h>
#include <unicode/ucol.h>
@@ -39,7 +41,6 @@
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/query/collation/collator_interface_icu.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/str.h"
namespace mongo {
@@ -754,8 +755,8 @@ StatusWith<std::unique_ptr<CollatorInterface>> CollatorFactoryICU::makeFromBSON(
return validateSpecStatus;
}
- auto mongoCollator = stdx::make_unique<CollatorInterfaceICU>(std::move(parsedSpec.getValue()),
- std::move(icuCollator));
+ auto mongoCollator = std::make_unique<CollatorInterfaceICU>(std::move(parsedSpec.getValue()),
+ std::move(icuCollator));
return {std::move(mongoCollator)};
}
diff --git a/src/mongo/db/query/collation/collator_factory_icu_decoration.cpp b/src/mongo/db/query/collation/collator_factory_icu_decoration.cpp
index df6233398ba..654f4f4c7b3 100644
--- a/src/mongo/db/query/collation/collator_factory_icu_decoration.cpp
+++ b/src/mongo/db/query/collation/collator_factory_icu_decoration.cpp
@@ -29,10 +29,11 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/base/init.h"
#include "mongo/db/query/collation/collator_factory_icu.h"
#include "mongo/db/service_context.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -42,7 +43,7 @@ ServiceContext::ConstructorActionRegisterer registerIcuCollator{
"CreateCollatorFactory",
{"LoadICUData"},
[](ServiceContext* service) {
- CollatorFactoryInterface::set(service, stdx::make_unique<CollatorFactoryICU>());
+ CollatorFactoryInterface::set(service, std::make_unique<CollatorFactoryICU>());
}};
} // namespace
diff --git a/src/mongo/db/query/collation/collator_factory_icu_test.cpp b/src/mongo/db/query/collation/collator_factory_icu_test.cpp
index 052e03decee..7024303dffd 100644
--- a/src/mongo/db/query/collation/collator_factory_icu_test.cpp
+++ b/src/mongo/db/query/collation/collator_factory_icu_test.cpp
@@ -31,9 +31,10 @@
#include "mongo/db/query/collation/collator_factory_icu.h"
+#include <memory>
+
#include "mongo/base/init.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
namespace {
diff --git a/src/mongo/db/query/collation/collator_factory_mock.cpp b/src/mongo/db/query/collation/collator_factory_mock.cpp
index e273572ff95..cc82e36522a 100644
--- a/src/mongo/db/query/collation/collator_factory_mock.cpp
+++ b/src/mongo/db/query/collation/collator_factory_mock.cpp
@@ -31,12 +31,13 @@
#include "mongo/db/query/collation/collator_factory_mock.h"
+#include <memory>
+
#include "mongo/base/status_with.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/query/collation/collator_interface_mock.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -46,7 +47,7 @@ StatusWith<std::unique_ptr<CollatorInterface>> CollatorFactoryMock::makeFromBSON
return {nullptr};
}
auto collator =
- stdx::make_unique<CollatorInterfaceMock>(CollatorInterfaceMock::MockType::kReverseString);
+ std::make_unique<CollatorInterfaceMock>(CollatorInterfaceMock::MockType::kReverseString);
return {std::move(collator)};
}
diff --git a/src/mongo/db/query/collation/collator_interface_icu.cpp b/src/mongo/db/query/collation/collator_interface_icu.cpp
index 28fcce5db7d..db35958c63a 100644
--- a/src/mongo/db/query/collation/collator_interface_icu.cpp
+++ b/src/mongo/db/query/collation/collator_interface_icu.cpp
@@ -31,10 +31,11 @@
#include "mongo/db/query/collation/collator_interface_icu.h"
+#include <memory>
+
#include <unicode/coll.h>
#include <unicode/sortkey.h>
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
namespace mongo {
@@ -44,7 +45,7 @@ CollatorInterfaceICU::CollatorInterfaceICU(CollationSpec spec,
: CollatorInterface(std::move(spec)), _collator(std::move(collator)) {}
std::unique_ptr<CollatorInterface> CollatorInterfaceICU::clone() const {
- auto clone = stdx::make_unique<CollatorInterfaceICU>(
+ auto clone = std::make_unique<CollatorInterfaceICU>(
getSpec(), std::unique_ptr<icu::Collator>(_collator->clone()));
return {std::move(clone)};
}
diff --git a/src/mongo/db/query/collation/collator_interface_mock.cpp b/src/mongo/db/query/collation/collator_interface_mock.cpp
index 405262bfb75..0ace0847984 100644
--- a/src/mongo/db/query/collation/collator_interface_mock.cpp
+++ b/src/mongo/db/query/collation/collator_interface_mock.cpp
@@ -33,9 +33,9 @@
#include <algorithm>
#include <cctype>
+#include <memory>
#include <string>
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
namespace mongo {
@@ -62,7 +62,7 @@ CollatorInterfaceMock::CollatorInterfaceMock(MockType mockType)
_mockType(mockType) {}
std::unique_ptr<CollatorInterface> CollatorInterfaceMock::clone() const {
- auto clone = stdx::make_unique<CollatorInterfaceMock>(_mockType);
+ auto clone = std::make_unique<CollatorInterfaceMock>(_mockType);
return {std::move(clone)};
}
diff --git a/src/mongo/db/query/datetime/date_time_support.cpp b/src/mongo/db/query/datetime/date_time_support.cpp
index 01397b1c605..0d8b8f0c684 100644
--- a/src/mongo/db/query/datetime/date_time_support.cpp
+++ b/src/mongo/db/query/datetime/date_time_support.cpp
@@ -39,7 +39,6 @@
#include "mongo/base/init.h"
#include "mongo/bson/util/builder.h"
#include "mongo/db/service_context.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/duration.h"
#include "mongo/util/log.h"
diff --git a/src/mongo/db/query/datetime/init_timezone_data.cpp b/src/mongo/db/query/datetime/init_timezone_data.cpp
index dea7322dd90..970e6db7de4 100644
--- a/src/mongo/db/query/datetime/init_timezone_data.cpp
+++ b/src/mongo/db/query/datetime/init_timezone_data.cpp
@@ -29,13 +29,14 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include <timelib.h>
#include "mongo/base/init.h"
#include "mongo/db/query/datetime/date_time_support.h"
#include "mongo/db/server_options.h"
#include "mongo/db/service_context.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/str.h"
namespace mongo {
@@ -53,10 +54,10 @@ ServiceContext::ConstructorActionRegisterer loadTimeZoneDB{
<< "\"");
}
TimeZoneDatabase::set(service,
- stdx::make_unique<TimeZoneDatabase>(std::move(timeZoneDatabase)));
+ std::make_unique<TimeZoneDatabase>(std::move(timeZoneDatabase)));
} else {
// No 'zoneInfo' specified on the command line, fall back to the built-in rules.
- TimeZoneDatabase::set(service, stdx::make_unique<TimeZoneDatabase>());
+ TimeZoneDatabase::set(service, std::make_unique<TimeZoneDatabase>());
}
}};
} // namespace
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp
index 10464c58641..ff1e443abc9 100644
--- a/src/mongo/db/query/find.cpp
+++ b/src/mongo/db/query/find.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/query/find.h"
+#include <memory>
+
#include "mongo/base/error_codes.h"
#include "mongo/db/auth/authorization_session.h"
#include "mongo/db/catalog/collection.h"
@@ -62,7 +64,6 @@
#include "mongo/db/views/view_catalog.h"
#include "mongo/s/chunk_version.h"
#include "mongo/s/stale_exception.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
@@ -71,7 +72,6 @@
namespace mongo {
using std::unique_ptr;
-using stdx::make_unique;
// Failpoint for checking whether we've received a getmore.
MONGO_FAIL_POINT_DEFINE(failReceivedGetmore);
diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp
index 27f3d451dac..eb3c8ec79d0 100644
--- a/src/mongo/db/query/get_executor.cpp
+++ b/src/mongo/db/query/get_executor.cpp
@@ -84,7 +84,6 @@
#include "mongo/db/storage/oplog_hack.h"
#include "mongo/db/storage/storage_options.h"
#include "mongo/scripting/engine.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
#include "mongo/util/str.h"
@@ -93,7 +92,6 @@ namespace mongo {
using std::string;
using std::unique_ptr;
using std::vector;
-using stdx::make_unique;
// static
void filterAllowedIndexEntries(const AllowedIndicesFilter& allowedIndicesFilter,
@@ -366,7 +364,7 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
const string& ns = canonicalQuery->ns();
LOG(2) << "Collection " << ns << " does not exist."
<< " Using EOF plan: " << redact(canonicalQuery->toStringShort());
- root = make_unique<EOFStage>(opCtx);
+ root = std::make_unique<EOFStage>(opCtx);
return PrepareExecutionResult(std::move(canonicalQuery), nullptr, std::move(root));
}
@@ -388,11 +386,11 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
if (descriptor && IDHackStage::supportsQuery(collection, *canonicalQuery)) {
LOG(2) << "Using idhack: " << redact(canonicalQuery->toStringShort());
- root = make_unique<IDHackStage>(opCtx, canonicalQuery.get(), ws, descriptor);
+ root = std::make_unique<IDHackStage>(opCtx, canonicalQuery.get(), ws, descriptor);
// Might have to filter out orphaned docs.
if (plannerParams.options & QueryPlannerParams::INCLUDE_SHARD_FILTER) {
- root = make_unique<ShardFilterStage>(
+ root = std::make_unique<ShardFilterStage>(
opCtx,
CollectionShardingState::get(opCtx, canonicalQuery->nss())->getOrphansFilter(opCtx),
ws,
@@ -406,12 +404,12 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
// Add a SortKeyGeneratorStage if there is a $meta sortKey projection.
if (canonicalQuery->getProj()->wantSortKey()) {
- root =
- make_unique<SortKeyGeneratorStage>(opCtx,
- root.release(),
- ws,
- canonicalQuery->getQueryRequest().getSort(),
- canonicalQuery->getCollator());
+ root = std::make_unique<SortKeyGeneratorStage>(
+ opCtx,
+ root.release(),
+ ws,
+ canonicalQuery->getQueryRequest().getSort(),
+ canonicalQuery->getCollator());
}
// Stuff the right data into the params depending on what proj impl we use.
@@ -419,14 +417,15 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
canonicalQuery->getProj()->wantIndexKey() ||
canonicalQuery->getProj()->wantSortKey() ||
canonicalQuery->getProj()->hasDottedFieldPath()) {
- root = make_unique<ProjectionStageDefault>(opCtx,
- canonicalQuery->getProj()->getProjObj(),
- ws,
- std::move(root),
- *canonicalQuery->root(),
- canonicalQuery->getCollator());
+ root = std::make_unique<ProjectionStageDefault>(
+ opCtx,
+ canonicalQuery->getProj()->getProjObj(),
+ ws,
+ std::move(root),
+ *canonicalQuery->root(),
+ canonicalQuery->getCollator());
} else {
- root = make_unique<ProjectionStageSimple>(
+ root = std::make_unique<ProjectionStageSimple>(
opCtx, canonicalQuery->getProj()->getProjObj(), ws, std::move(root));
}
}
@@ -474,13 +473,13 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
//
// 'decisionWorks' is used to determine whether the existing cache entry should
// be evicted, and the query replanned.
- root = make_unique<CachedPlanStage>(opCtx,
- collection,
- ws,
- canonicalQuery.get(),
- plannerParams,
- cs->decisionWorks,
- rawRoot);
+ root = std::make_unique<CachedPlanStage>(opCtx,
+ collection,
+ ws,
+ canonicalQuery.get(),
+ plannerParams,
+ cs->decisionWorks,
+ rawRoot);
return PrepareExecutionResult(
std::move(canonicalQuery), std::move(querySolution), std::move(root));
}
@@ -491,8 +490,8 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
SubplanStage::canUseSubplanning(*canonicalQuery)) {
LOG(2) << "Running query as sub-queries: " << redact(canonicalQuery->toStringShort());
- root =
- make_unique<SubplanStage>(opCtx, collection, ws, plannerParams, canonicalQuery.get());
+ root = std::make_unique<SubplanStage>(
+ opCtx, collection, ws, plannerParams, canonicalQuery.get());
return PrepareExecutionResult(std::move(canonicalQuery), nullptr, std::move(root));
}
@@ -547,7 +546,8 @@ StatusWith<PrepareExecutionResult> prepareExecution(OperationContext* opCtx,
} else {
// Many solutions. Create a MultiPlanStage to pick the best, update the cache,
// and so on. The working set will be shared by all candidate plans.
- auto multiPlanStage = make_unique<MultiPlanStage>(opCtx, collection, canonicalQuery.get());
+ auto multiPlanStage =
+ std::make_unique<MultiPlanStage>(opCtx, collection, canonicalQuery.get());
for (size_t ix = 0; ix < solutions.size(); ++ix) {
if (solutions[ix]->cacheData.get()) {
@@ -576,7 +576,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutor(
unique_ptr<CanonicalQuery> canonicalQuery,
PlanExecutor::YieldPolicy yieldPolicy,
size_t plannerOptions) {
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
StatusWith<PrepareExecutionResult> executionResult =
prepareExecution(opCtx, collection, ws.get(), std::move(canonicalQuery), plannerOptions);
if (!executionResult.isOK()) {
@@ -722,8 +722,8 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getOplogStartHack(
params.stopApplyingFilterAfterFirstMatch = true;
}
- auto ws = make_unique<WorkingSet>();
- auto cs = make_unique<CollectionScan>(opCtx, collection, params, ws.get(), cq->root());
+ auto ws = std::make_unique<WorkingSet>();
+ auto cs = std::make_unique<CollectionScan>(opCtx, collection, params, ws.get(), cq->root());
return PlanExecutor::make(
opCtx, std::move(ws), std::move(cs), std::move(cq), collection, PlanExecutor::YIELD_AUTO);
}
@@ -811,12 +811,12 @@ StatusWith<unique_ptr<PlanStage>> applyProjection(OperationContext* opCtx,
"Cannot use a $meta sortKey projection in findAndModify commands."};
}
- return {make_unique<ProjectionStageDefault>(opCtx,
- proj,
- ws,
- std::unique_ptr<PlanStage>(root.release()),
- *cq->root(),
- cq->getCollator())};
+ return {std::make_unique<ProjectionStageDefault>(opCtx,
+ proj,
+ ws,
+ std::unique_ptr<PlanStage>(root.release()),
+ *cq->root(),
+ cq->getCollator())};
}
} // namespace
@@ -862,7 +862,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorDelete(
deleteStageParams->opDebug = opDebug;
deleteStageParams->stmtId = request->getStmtId();
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
const PlanExecutor::YieldPolicy policy = parsedDelete->yieldPolicy();
if (!collection) {
@@ -900,7 +900,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorDelete(
auto idHackStage = std::make_unique<IDHackStage>(
opCtx, unparsedQuery["_id"].wrap(), ws.get(), descriptor);
- unique_ptr<DeleteStage> root = make_unique<DeleteStage>(
+ unique_ptr<DeleteStage> root = std::make_unique<DeleteStage>(
opCtx, std::move(deleteStageParams), ws.get(), collection, idHackStage.release());
return PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, policy);
}
@@ -929,7 +929,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorDelete(
deleteStageParams->canonicalQuery = cq.get();
invariant(root);
- root = make_unique<DeleteStage>(
+ root = std::make_unique<DeleteStage>(
opCtx, std::move(deleteStageParams), ws.get(), collection, root.release());
if (!request->getProj().isEmpty()) {
@@ -1003,7 +1003,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorUpdate(
const PlanExecutor::YieldPolicy policy = parsedUpdate->yieldPolicy();
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
UpdateStageParams updateStageParams(request, driver, opDebug);
// If the collection doesn't exist, then return a PlanExecutor for a no-op EOF plan. We have
@@ -1070,7 +1070,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorUpdate(
invariant(root);
updateStageParams.canonicalQuery = cq.get();
- root = stdx::make_unique<UpdateStage>(
+ root = std::make_unique<UpdateStage>(
opCtx, updateStageParams, ws.get(), collection, root.release());
if (!request->getProj().isEmpty()) {
@@ -1218,9 +1218,9 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorCount(
const CountCommand& request,
bool explain,
const NamespaceString& nss) {
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(request.getQuery());
auto collation = request.getCollation().value_or(BSONObj());
qr->setCollation(collation);
@@ -1255,8 +1255,8 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorCount(
// Treat collections that do not exist as empty collections. Note that the explain reporting
// machinery always assumes that the root stage for a count operation is a CountStage, so in
// this case we put a CountStage on top of an EOFStage.
- unique_ptr<PlanStage> root =
- make_unique<CountStage>(opCtx, collection, limit, skip, ws.get(), new EOFStage(opCtx));
+ unique_ptr<PlanStage> root = std::make_unique<CountStage>(
+ opCtx, collection, limit, skip, ws.get(), new EOFStage(opCtx));
return PlanExecutor::make(opCtx, std::move(ws), std::move(root), nss, yieldPolicy);
}
@@ -1271,7 +1271,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorCount(
if (useRecordStoreCount) {
unique_ptr<PlanStage> root =
- make_unique<RecordStoreFastCountStage>(opCtx, collection, skip, limit);
+ std::make_unique<RecordStoreFastCountStage>(opCtx, collection, skip, limit);
return PlanExecutor::make(opCtx, std::move(ws), std::move(root), nss, yieldPolicy);
}
@@ -1292,7 +1292,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorCount(
invariant(root);
// Make a CountStage to be the new root.
- root = make_unique<CountStage>(opCtx, collection, limit, skip, ws.get(), root.release());
+ root = std::make_unique<CountStage>(opCtx, collection, limit, skip, ws.get(), root.release());
// We must have a tree of stages in order to have a valid plan executor, but the query
// solution may be NULL. Takes ownership of all args other than 'collection' and 'opCtx'
return PlanExecutor::make(opCtx,
@@ -1430,7 +1430,7 @@ bool turnIxscanIntoDistinctIxscan(QuerySolution* soln,
}
// Make a new DistinctNode. We will swap this for the ixscan in the provided solution.
- auto distinctNode = stdx::make_unique<DistinctNode>(indexScanNode->index);
+ auto distinctNode = std::make_unique<DistinctNode>(indexScanNode->index);
distinctNode->direction = indexScanNode->direction;
distinctNode->bounds = indexScanNode->bounds;
distinctNode->queryCollator = indexScanNode->queryCollator;
@@ -1561,7 +1561,7 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorForS
return {nullptr};
}
- auto dn = stdx::make_unique<DistinctNode>(plannerParams.indices[distinctNodeIndex]);
+ auto dn = std::make_unique<DistinctNode>(plannerParams.indices[distinctNodeIndex]);
dn->direction = 1;
IndexBoundsBuilder::allValuesBounds(dn->index.keyPattern, &dn->bounds);
dn->queryCollator = collator;
@@ -1571,7 +1571,7 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorForS
std::unique_ptr<QuerySolutionNode> solnRoot = std::move(dn);
if (plannerParams.indices[distinctNodeIndex].collator) {
if (!solnRoot->fetched()) {
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
fetch->children.push_back(solnRoot.release());
solnRoot = std::move(fetch);
}
@@ -1583,7 +1583,7 @@ StatusWith<std::unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorForS
*parsedDistinct->getQuery(), params, std::move(solnRoot));
invariant(soln);
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
PlanStage* rawRoot;
verify(StageBuilder::build(
opCtx, collection, *parsedDistinct->getQuery(), *soln, ws.get(), &rawRoot));
@@ -1625,7 +1625,7 @@ getExecutorDistinctFromIndexSolutions(OperationContext* opCtx,
if (turnIxscanIntoDistinctIxscan(
solutions[i].get(), parsedDistinct->getKey(), strictDistinctOnly)) {
// Build and return the SSR over solutions[i].
- unique_ptr<WorkingSet> ws = make_unique<WorkingSet>();
+ unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
unique_ptr<QuerySolution> currentSolution = std::move(solutions[i]);
PlanStage* rawRoot;
verify(StageBuilder::build(opCtx,
@@ -1662,7 +1662,7 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorWithoutPr
const CanonicalQuery* cq,
PlanExecutor::YieldPolicy yieldPolicy,
size_t plannerOptions) {
- auto qr = stdx::make_unique<QueryRequest>(cq->getQueryRequest());
+ auto qr = std::make_unique<QueryRequest>(cq->getQueryRequest());
qr->setProj(BSONObj());
const boost::intrusive_ptr<ExpressionContext> expCtx;
@@ -1693,8 +1693,8 @@ StatusWith<unique_ptr<PlanExecutor, PlanExecutor::Deleter>> getExecutorDistinct(
if (!collection) {
// Treat collections that do not exist as empty collections.
return PlanExecutor::make(opCtx,
- make_unique<WorkingSet>(),
- make_unique<EOFStage>(opCtx),
+ std::make_unique<WorkingSet>(),
+ std::make_unique<EOFStage>(opCtx),
parsedDistinct->releaseQuery(),
collection,
yieldPolicy);
diff --git a/src/mongo/db/query/get_executor_test.cpp b/src/mongo/db/query/get_executor_test.cpp
index 16cdf77016a..6281cedc01a 100644
--- a/src/mongo/db/query/get_executor_test.cpp
+++ b/src/mongo/db/query/get_executor_test.cpp
@@ -61,7 +61,7 @@ unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson(queryStr));
qr->setSort(fromjson(sortStr));
qr->setProj(fromjson(projStr));
diff --git a/src/mongo/db/query/index_tag.cpp b/src/mongo/db/query/index_tag.cpp
index 5fe91012a3a..0381e2ac9ba 100644
--- a/src/mongo/db/query/index_tag.cpp
+++ b/src/mongo/db/query/index_tag.cpp
@@ -120,7 +120,7 @@ void attachNode(MatchExpression* node,
AndMatchExpression* andNode = static_cast<AndMatchExpression*>(target);
andNode->add(clone.release());
} else {
- std::unique_ptr<AndMatchExpression> andNode = stdx::make_unique<AndMatchExpression>();
+ std::unique_ptr<AndMatchExpression> andNode = std::make_unique<AndMatchExpression>();
IndexTag* indexTag = static_cast<IndexTag*>(clone->getTag());
andNode->setTag(new IndexTag(indexTag->index));
andNode->add(target);
diff --git a/src/mongo/db/query/index_tag.h b/src/mongo/db/query/index_tag.h
index 0afa60d7130..be4423d3179 100644
--- a/src/mongo/db/query/index_tag.h
+++ b/src/mongo/db/query/index_tag.h
@@ -207,7 +207,7 @@ public:
}
MatchExpression::TagData* clone() const override {
- std::unique_ptr<OrPushdownTag> clone = stdx::make_unique<OrPushdownTag>();
+ std::unique_ptr<OrPushdownTag> clone = std::make_unique<OrPushdownTag>();
for (const auto& dest : _destinations) {
clone->addDestination(dest.clone());
}
diff --git a/src/mongo/db/query/internal_plans.cpp b/src/mongo/db/query/internal_plans.cpp
index f303d1169ba..bfd88fb27df 100644
--- a/src/mongo/db/query/internal_plans.cpp
+++ b/src/mongo/db/query/internal_plans.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/query/internal_plans.h"
+#include <memory>
+
#include "mongo/db/catalog/database.h"
#include "mongo/db/client.h"
#include "mongo/db/exec/collection_scan.h"
@@ -41,7 +43,6 @@
#include "mongo/db/exec/index_scan.h"
#include "mongo/db/exec/update_stage.h"
#include "mongo/db/query/get_executor.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
@@ -52,10 +53,10 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::collection
PlanExecutor::YieldPolicy yieldPolicy,
const Direction direction,
const RecordId startLoc) {
- std::unique_ptr<WorkingSet> ws = stdx::make_unique<WorkingSet>();
+ std::unique_ptr<WorkingSet> ws = std::make_unique<WorkingSet>();
if (NULL == collection) {
- auto eof = stdx::make_unique<EOFStage>(opCtx);
+ auto eof = std::make_unique<EOFStage>(opCtx);
// Takes ownership of 'ws' and 'eof'.
auto statusWithPlanExecutor = PlanExecutor::make(
opCtx, std::move(ws), std::move(eof), NamespaceString(ns), yieldPolicy);
@@ -82,11 +83,11 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith
Direction direction,
const RecordId& startLoc) {
invariant(collection);
- auto ws = stdx::make_unique<WorkingSet>();
+ auto ws = std::make_unique<WorkingSet>();
auto root = _collectionScan(opCtx, ws.get(), collection, direction, startLoc);
- root = stdx::make_unique<DeleteStage>(
+ root = std::make_unique<DeleteStage>(
opCtx, std::move(params), ws.get(), collection, root.release());
auto executor =
@@ -106,7 +107,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::indexScan(
PlanExecutor::YieldPolicy yieldPolicy,
Direction direction,
int options) {
- auto ws = stdx::make_unique<WorkingSet>();
+ auto ws = std::make_unique<WorkingSet>();
std::unique_ptr<PlanStage> root = _indexScan(opCtx,
ws.get(),
@@ -135,7 +136,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith
PlanExecutor::YieldPolicy yieldPolicy,
Direction direction) {
invariant(collection);
- auto ws = stdx::make_unique<WorkingSet>();
+ auto ws = std::make_unique<WorkingSet>();
std::unique_ptr<PlanStage> root = _indexScan(opCtx,
ws.get(),
@@ -147,7 +148,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::deleteWith
direction,
InternalPlanner::IXSCAN_FETCH);
- root = stdx::make_unique<DeleteStage>(
+ root = std::make_unique<DeleteStage>(
opCtx, std::move(params), ws.get(), collection, root.release());
auto executor =
@@ -164,11 +165,11 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> InternalPlanner::updateWith
const BSONObj& key,
PlanExecutor::YieldPolicy yieldPolicy) {
invariant(collection);
- auto ws = stdx::make_unique<WorkingSet>();
+ auto ws = std::make_unique<WorkingSet>();
- auto idHackStage = stdx::make_unique<IDHackStage>(opCtx, key, ws.get(), descriptor);
+ auto idHackStage = std::make_unique<IDHackStage>(opCtx, key, ws.get(), descriptor);
auto root =
- stdx::make_unique<UpdateStage>(opCtx, params, ws.get(), collection, idHackStage.release());
+ std::make_unique<UpdateStage>(opCtx, params, ws.get(), collection, idHackStage.release());
auto executor =
PlanExecutor::make(opCtx, std::move(ws), std::move(root), collection, yieldPolicy);
@@ -193,7 +194,7 @@ std::unique_ptr<PlanStage> InternalPlanner::_collectionScan(OperationContext* op
params.direction = CollectionScanParams::BACKWARD;
}
- return stdx::make_unique<CollectionScan>(opCtx, collection, params, ws, nullptr);
+ return std::make_unique<CollectionScan>(opCtx, collection, params, ws, nullptr);
}
std::unique_ptr<PlanStage> InternalPlanner::_indexScan(OperationContext* opCtx,
@@ -217,10 +218,10 @@ std::unique_ptr<PlanStage> InternalPlanner::_indexScan(OperationContext* opCtx,
params.shouldDedup = descriptor->isMultikey(opCtx);
std::unique_ptr<PlanStage> root =
- stdx::make_unique<IndexScan>(opCtx, std::move(params), ws, nullptr);
+ std::make_unique<IndexScan>(opCtx, std::move(params), ws, nullptr);
if (InternalPlanner::IXSCAN_FETCH & options) {
- root = stdx::make_unique<FetchStage>(opCtx, ws, root.release(), nullptr, collection);
+ root = std::make_unique<FetchStage>(opCtx, ws, root.release(), nullptr, collection);
}
return root;
diff --git a/src/mongo/db/query/parsed_distinct.cpp b/src/mongo/db/query/parsed_distinct.cpp
index 2d5a74af4c0..9ade1492a5d 100644
--- a/src/mongo/db/query/parsed_distinct.cpp
+++ b/src/mongo/db/query/parsed_distinct.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/query/parsed_distinct.h"
+#include <memory>
+
#include "mongo/bson/bsonelement.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/query/canonical_query.h"
@@ -38,7 +40,6 @@
#include "mongo/db/query/query_request.h"
#include "mongo/db/repl/read_concern_args.h"
#include "mongo/idl/idl_parser.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/str.h"
namespace mongo {
@@ -265,7 +266,7 @@ StatusWith<ParsedDistinct> ParsedDistinct::parse(OperationContext* opCtx,
return exceptionToStatus();
}
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
if (parsedDistinct.getKey().find('\0') != std::string::npos) {
return Status(ErrorCodes::Error(31032), "Key field cannot contain an embedded null byte");
diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp
index 4defd1cdd20..ba32ff91e7f 100644
--- a/src/mongo/db/query/plan_cache.cpp
+++ b/src/mongo/db/query/plan_cache.cpp
@@ -222,7 +222,7 @@ PlanCacheEntry::~PlanCacheEntry() {
PlanCacheEntry* PlanCacheEntry::clone() const {
std::vector<std::unique_ptr<QuerySolution>> solutions;
for (size_t i = 0; i < plannerData.size(); ++i) {
- auto qs = stdx::make_unique<QuerySolution>();
+ auto qs = std::make_unique<QuerySolution>();
qs->cacheData.reset(plannerData[i]->clone());
solutions.push_back(std::move(qs));
}
@@ -585,7 +585,7 @@ PlanCache::GetResult PlanCache::get(const PlanCacheKey& key) const {
auto state =
entry->isActive ? CacheEntryState::kPresentActive : CacheEntryState::kPresentInactive;
- return {state, stdx::make_unique<CachedSolution>(key, *entry)};
+ return {state, std::make_unique<CachedSolution>(key, *entry)};
}
Status PlanCache::feedback(const CanonicalQuery& cq, double score) {
diff --git a/src/mongo/db/query/plan_cache_indexability.cpp b/src/mongo/db/query/plan_cache_indexability.cpp
index 7687ed1dca6..9e0d9f717c6 100644
--- a/src/mongo/db/query/plan_cache_indexability.cpp
+++ b/src/mongo/db/query/plan_cache_indexability.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/query/plan_cache_indexability.h"
+#include <memory>
+
#include "mongo/base/init.h"
#include "mongo/base/owned_pointer_vector.h"
#include "mongo/db/index/wildcard_key_generator.h"
@@ -42,7 +44,6 @@
#include "mongo/db/query/collation/collator_interface.h"
#include "mongo/db/query/index_entry.h"
#include "mongo/db/query/planner_ixselect.h"
-#include "mongo/stdx/memory.h"
#include <memory>
namespace mongo {
diff --git a/src/mongo/db/query/plan_cache_test.cpp b/src/mongo/db/query/plan_cache_test.cpp
index 5614137b90a..c6543f5da59 100644
--- a/src/mongo/db/query/plan_cache_test.cpp
+++ b/src/mongo/db/query/plan_cache_test.cpp
@@ -74,7 +74,7 @@ unique_ptr<CanonicalQuery> canonicalize(const BSONObj& queryObj) {
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(queryObj);
const boost::intrusive_ptr<ExpressionContext> expCtx;
auto statusWithCQ =
@@ -99,7 +99,7 @@ unique_ptr<CanonicalQuery> canonicalize(BSONObj query,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(query);
qr->setSort(sort);
qr->setProj(proj);
@@ -134,7 +134,7 @@ unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson(queryStr));
qr->setSort(fromjson(sortStr));
qr->setProj(fromjson(projStr));
@@ -170,7 +170,7 @@ unique_ptr<CanonicalQuery> canonicalize(const char* queryStr,
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(fromjson(queryStr));
qr->setSort(fromjson(sortStr));
qr->setProj(fromjson(projStr));
@@ -298,7 +298,7 @@ std::unique_ptr<PlanRankingDecision> createDecision(size_t numPlans, size_t work
unique_ptr<PlanRankingDecision> why(new PlanRankingDecision());
for (size_t i = 0; i < numPlans; ++i) {
CommonStats common("COLLSCAN");
- auto stats = stdx::make_unique<PlanStageStats>(common, STAGE_COLLSCAN);
+ auto stats = std::make_unique<PlanStageStats>(common, STAGE_COLLSCAN);
stats->specific.reset(new CollectionScanStats());
why->stats.push_back(std::move(stats));
why->stats[i]->common.works = works;
@@ -344,8 +344,8 @@ void assertShouldNotCacheQuery(const char* queryStr) {
std::unique_ptr<QuerySolution> getQuerySolutionForCaching() {
std::unique_ptr<QuerySolution> qs = std::make_unique<QuerySolution>();
- qs->cacheData = stdx::make_unique<SolutionCacheData>();
- qs->cacheData->tree = stdx::make_unique<PlanCacheIndexTree>();
+ qs->cacheData = std::make_unique<SolutionCacheData>();
+ qs->cacheData->tree = std::make_unique<PlanCacheIndexTree>();
return qs;
}
@@ -1108,7 +1108,7 @@ protected:
QueryTestServiceContext serviceContext;
auto opCtx = serviceContext.makeOperationContext();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(query);
qr->setSort(sort);
qr->setProj(proj);
diff --git a/src/mongo/db/query/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator.cpp
index 7c6d498007c..19f2188f303 100644
--- a/src/mongo/db/query/plan_enumerator.cpp
+++ b/src/mongo/db/query/plan_enumerator.cpp
@@ -805,7 +805,7 @@ void PlanEnumerator::assignPredicate(
// This method should only be called if we can combine bounds.
const bool canCombineBounds = true;
dest.tagData =
- stdx::make_unique<IndexTag>(indexAssignment->index, position, canCombineBounds);
+ std::make_unique<IndexTag>(indexAssignment->index, position, canCombineBounds);
indexAssignment->orPushdowns.emplace_back(pred, std::move(dest));
} else {
indexAssignment->preds.push_back(pred);
diff --git a/src/mongo/db/query/plan_executor_impl.cpp b/src/mongo/db/query/plan_executor_impl.cpp
index b01b49efba9..849993364c5 100644
--- a/src/mongo/db/query/plan_executor_impl.cpp
+++ b/src/mongo/db/query/plan_executor_impl.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/query/plan_executor_impl.h"
+#include <memory>
+
#include "mongo/bson/simple_bsonobj_comparator.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
@@ -54,7 +56,6 @@
#include "mongo/db/query/plan_yield_policy.h"
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/service_context.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/fail_point_service.h"
#include "mongo/util/log.h"
#include "mongo/util/scopeguard.h"
@@ -91,13 +92,13 @@ std::unique_ptr<PlanYieldPolicy> makeYieldPolicy(PlanExecutor* exec,
case PlanExecutor::YieldPolicy::NO_YIELD:
case PlanExecutor::YieldPolicy::WRITE_CONFLICT_RETRY_ONLY:
case PlanExecutor::YieldPolicy::INTERRUPT_ONLY: {
- return stdx::make_unique<PlanYieldPolicy>(exec, policy);
+ return std::make_unique<PlanYieldPolicy>(exec, policy);
}
case PlanExecutor::YieldPolicy::ALWAYS_TIME_OUT: {
- return stdx::make_unique<AlwaysTimeOutYieldPolicy>(exec);
+ return std::make_unique<AlwaysTimeOutYieldPolicy>(exec);
}
case PlanExecutor::YieldPolicy::ALWAYS_MARK_KILLED: {
- return stdx::make_unique<AlwaysPlanKilledYieldPolicy>(exec);
+ return std::make_unique<AlwaysPlanKilledYieldPolicy>(exec);
}
default:
MONGO_UNREACHABLE;
diff --git a/src/mongo/db/query/planner_access.cpp b/src/mongo/db/query/planner_access.cpp
index 7065fa25e9b..9ac03670c3a 100644
--- a/src/mongo/db/query/planner_access.cpp
+++ b/src/mongo/db/query/planner_access.cpp
@@ -50,7 +50,6 @@
#include "mongo/db/query/query_knobs_gen.h"
#include "mongo/db/query/query_planner.h"
#include "mongo/db/query/query_planner_common.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
#include "mongo/util/transitional_tools_do_not_use/vector_spooling.h"
@@ -143,12 +142,11 @@ namespace mongo {
using std::unique_ptr;
using std::vector;
-using stdx::make_unique;
std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeCollectionScan(
const CanonicalQuery& query, bool tailable, const QueryPlannerParams& params) {
// Make the (only) node, a collection scan.
- auto csn = stdx::make_unique<CollectionScanNode>();
+ auto csn = std::make_unique<CollectionScanNode>();
csn->name = query.ns();
csn->filter = query.root()->shallowClone();
csn->tailable = tailable;
@@ -204,7 +202,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeLeafNode(
bool indexIs2D = (String == elt.type() && "2d" == elt.String());
if (indexIs2D) {
- auto ret = stdx::make_unique<GeoNear2DNode>(index);
+ auto ret = std::make_unique<GeoNear2DNode>(index);
ret->nq = &nearExpr->getData();
ret->baseBounds.fields.resize(index.keyPattern.nFields());
if (NULL != query.getProj()) {
@@ -214,7 +212,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeLeafNode(
return std::move(ret);
} else {
- auto ret = stdx::make_unique<GeoNear2DSphereNode>(index);
+ auto ret = std::make_unique<GeoNear2DSphereNode>(index);
ret->nq = &nearExpr->getData();
ret->baseBounds.fields.resize(index.keyPattern.nFields());
if (NULL != query.getProj()) {
@@ -227,7 +225,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeLeafNode(
// We must not keep the expression node around.
*tightnessOut = IndexBoundsBuilder::EXACT;
auto textExpr = static_cast<const TextMatchExpressionBase*>(expr);
- auto ret = stdx::make_unique<TextNode>(index);
+ auto ret = std::make_unique<TextNode>(index);
ret->ftsQuery = textExpr->getFTSQuery().clone();
// Count the number of prefix fields before the "text" field.
@@ -244,7 +242,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeLeafNode(
} else {
// Note that indexKeyPattern.firstElement().fieldName() may not equal expr->path()
// because expr might be inside an array operator that provides a path prefix.
- auto isn = stdx::make_unique<IndexScanNode>(index);
+ auto isn = std::make_unique<IndexScanNode>(index);
isn->bounds.fields.resize(index.keyPattern.nFields());
isn->addKeyMetadata = query.getQueryRequest().returnKey();
isn->queryCollator = query.getCollator();
@@ -552,7 +550,7 @@ void QueryPlannerAccess::finishAndOutputLeaf(ScanBuildingState* scanState,
// In order to correctly evaluate the predicates for this index, we have to
// fetch the full documents. Add a fetch node above the index scan whose filter
// includes *all* of the predicates used to generate the ixscan.
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
// Takes ownership.
fetch->filter = std::move(scanState->curOr);
// Takes ownership.
@@ -700,7 +698,7 @@ std::vector<std::unique_ptr<QuerySolutionNode>> QueryPlannerAccess::collapseEqui
// Both the 'from' and 'into' nodes have filters. We join them with an
// OrMatchExpression.
std::unique_ptr<OrMatchExpression> collapsedFilter =
- stdx::make_unique<OrMatchExpression>();
+ std::make_unique<OrMatchExpression>();
collapsedFilter->add(collapseFromFetch->filter.release());
collapsedFilter->add(collapseIntoFetch->filter.release());
@@ -1012,12 +1010,12 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::buildIndexedAnd(
}
}
if (allSortedByDiskLoc) {
- auto asn = stdx::make_unique<AndSortedNode>();
+ auto asn = std::make_unique<AndSortedNode>();
asn->addChildren(std::move(ixscanNodes));
andResult = std::move(asn);
} else if (internalQueryPlannerEnableHashIntersection.load()) {
{
- auto ahn = stdx::make_unique<AndHashNode>();
+ auto ahn = std::make_unique<AndHashNode>();
ahn->addChildren(std::move(ixscanNodes));
andResult = std::move(ahn);
}
@@ -1054,7 +1052,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::buildIndexedAnd(
// matches all indexed predicates simultaneously. Therefore, it is necessary to add a fetch
// stage which will explicitly evaluate the entire predicate (see SERVER-16750).
invariant(clonedRoot);
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
fetch->filter = std::move(clonedRoot);
// Takes ownership of 'andResult'.
fetch->children.push_back(andResult.release());
@@ -1064,7 +1062,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::buildIndexedAnd(
// If there are any nodes still attached to the AND, we can't answer them using the
// index, so we put a fetch with filter.
if (root->numChildren() > 0) {
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
verify(ownedRoot);
if (ownedRoot->numChildren() == 1) {
// An $and of one thing is that thing.
@@ -1140,12 +1138,12 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::buildIndexedOr(
}
}
- auto msn = stdx::make_unique<MergeSortNode>();
+ auto msn = std::make_unique<MergeSortNode>();
msn->sort = query.getQueryRequest().getSort();
msn->addChildren(std::move(ixscanNodes));
orResult = std::move(msn);
} else {
- auto orn = stdx::make_unique<OrNode>();
+ auto orn = std::make_unique<OrNode>();
orn->addChildren(std::move(ixscanNodes));
orResult = std::move(orn);
}
@@ -1222,7 +1220,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::_buildIndexedDataAccess(
soln->filter = std::move(ownedRoot);
return soln;
} else {
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
fetch->filter = std::move(ownedRoot);
fetch->children.push_back(soln.release());
return std::move(fetch);
@@ -1246,7 +1244,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::_buildIndexedDataAccess(
return solution;
}
- auto fetch = stdx::make_unique<FetchNode>();
+ auto fetch = std::make_unique<FetchNode>();
fetch->filter = std::move(ownedRoot);
fetch->children.push_back(solution.release());
return std::move(fetch);
@@ -1264,7 +1262,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::scanWholeIndex(
std::unique_ptr<QuerySolutionNode> solnRoot;
// Build an ixscan over the id index, use it, and return it.
- unique_ptr<IndexScanNode> isn = make_unique<IndexScanNode>(index);
+ unique_ptr<IndexScanNode> isn = std::make_unique<IndexScanNode>(index);
isn->addKeyMetadata = query.getQueryRequest().returnKey();
isn->queryCollator = query.getCollator();
@@ -1283,7 +1281,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::scanWholeIndex(
} else {
// TODO: We may not need to do the fetch if the predicates in root are covered. But
// for now it's safe (though *maybe* slower).
- unique_ptr<FetchNode> fetch = make_unique<FetchNode>();
+ unique_ptr<FetchNode> fetch = std::make_unique<FetchNode>();
fetch->filter = std::move(filter);
fetch->children.push_back(isn.release());
solnRoot = std::move(fetch);
@@ -1308,10 +1306,10 @@ void QueryPlannerAccess::addFilterToSolutionNode(QuerySolutionNode* node,
// by adding an OR node.
unique_ptr<ListOfMatchExpression> listFilter;
if (MatchExpression::AND == type) {
- listFilter = make_unique<AndMatchExpression>();
+ listFilter = std::make_unique<AndMatchExpression>();
} else {
verify(MatchExpression::OR == type);
- listFilter = make_unique<OrMatchExpression>();
+ listFilter = std::make_unique<OrMatchExpression>();
}
unique_ptr<MatchExpression> oldFilter = node->filter->shallowClone();
listFilter->add(oldFilter.release());
@@ -1395,7 +1393,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeIndexScan(
std::unique_ptr<QuerySolutionNode> solnRoot;
// Build an ixscan over the id index, use it, and return it.
- auto isn = stdx::make_unique<IndexScanNode>(index);
+ auto isn = std::make_unique<IndexScanNode>(index);
isn->direction = 1;
isn->addKeyMetadata = query.getQueryRequest().returnKey();
isn->bounds.isSimpleRange = true;
@@ -1412,7 +1410,7 @@ std::unique_ptr<QuerySolutionNode> QueryPlannerAccess::makeIndexScan(
} else {
// TODO: We may not need to do the fetch if the predicates in root are covered. But
// for now it's safe (though *maybe* slower).
- unique_ptr<FetchNode> fetch = make_unique<FetchNode>();
+ unique_ptr<FetchNode> fetch = std::make_unique<FetchNode>();
fetch->filter = std::move(filter);
fetch->children.push_back(isn.release());
solnRoot = std::move(fetch);
diff --git a/src/mongo/db/query/planner_access.h b/src/mongo/db/query/planner_access.h
index e663b0a6189..e0744d55311 100644
--- a/src/mongo/db/query/planner_access.h
+++ b/src/mongo/db/query/planner_access.h
@@ -163,7 +163,7 @@ private:
loosestBounds = IndexBoundsBuilder::EXACT;
if (MatchExpression::OR == root->matchType()) {
- curOr = stdx::make_unique<OrMatchExpression>();
+ curOr = std::make_unique<OrMatchExpression>();
}
}
diff --git a/src/mongo/db/query/planner_analysis_test.cpp b/src/mongo/db/query/planner_analysis_test.cpp
index d7c7fe5ffc8..57102d314cf 100644
--- a/src/mongo/db/query/planner_analysis_test.cpp
+++ b/src/mongo/db/query/planner_analysis_test.cpp
@@ -195,9 +195,9 @@ TEST(QueryPlannerAnalysis, GeoSkipValidation) {
QueryPlannerParams params;
- std::unique_ptr<FetchNode> fetchNodePtr = stdx::make_unique<FetchNode>();
+ std::unique_ptr<FetchNode> fetchNodePtr = std::make_unique<FetchNode>();
std::unique_ptr<GeoMatchExpression> exprPtr =
- stdx::make_unique<GeoMatchExpression>("geometry.field", nullptr, BSONObj());
+ std::make_unique<GeoMatchExpression>("geometry.field", nullptr, BSONObj());
GeoMatchExpression* expr = exprPtr.get();
diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp
index 9e8349b18d5..ad97acfc6c1 100644
--- a/src/mongo/db/query/query_planner.cpp
+++ b/src/mongo/db/query/query_planner.cpp
@@ -303,7 +303,7 @@ StatusWith<std::unique_ptr<PlanCacheIndexTree>> QueryPlanner::cacheDataFromTagge
return Status(ErrorCodes::BadValue, "Cannot produce cache data: tree is NULL.");
}
- auto indexTree = stdx::make_unique<PlanCacheIndexTree>();
+ auto indexTree = std::make_unique<PlanCacheIndexTree>();
if (taggedTree->getTag() &&
taggedTree->getTag()->getType() == MatchExpression::TagData::Type::IndexTag) {
@@ -341,7 +341,7 @@ StatusWith<std::unique_ptr<PlanCacheIndexTree>> QueryPlanner::cacheDataFromTagge
}
std::unique_ptr<IndexEntry> indexEntry =
- stdx::make_unique<IndexEntry>(relevantIndices[itag->index]);
+ std::make_unique<IndexEntry>(relevantIndices[itag->index]);
indexTree->entry.reset(indexEntry.release());
indexTree->index_pos = itag->pos;
indexTree->canCombineBounds = itag->canCombineBounds;
@@ -411,7 +411,7 @@ Status QueryPlanner::tagAccordingToCache(MatchExpression* filter,
}
OrPushdownTag::Destination dest;
dest.route = orPushdown.route;
- dest.tagData = stdx::make_unique<IndexTag>(
+ dest.tagData = std::make_unique<IndexTag>(
index->second, orPushdown.position, orPushdown.canCombineBounds);
orPushdownTag->addDestination(std::move(dest));
}
diff --git a/src/mongo/db/query/query_planner_test.cpp b/src/mongo/db/query/query_planner_test.cpp
index 3c38b272fd1..757625df59d 100644
--- a/src/mongo/db/query/query_planner_test.cpp
+++ b/src/mongo/db/query/query_planner_test.cpp
@@ -4610,7 +4610,7 @@ TEST_F(QueryPlannerTest, CacheDataFromTaggedTreeFailsOnBadInput) {
// No relevant index matching the index tag.
relevantIndices.push_back(buildSimpleIndexEntry(BSON("a" << 1), "a_1"));
- auto qr = stdx::make_unique<QueryRequest>(NamespaceString("test.collection"));
+ auto qr = std::make_unique<QueryRequest>(NamespaceString("test.collection"));
qr->setFilter(BSON("a" << 3));
auto statusWithCQ = CanonicalQuery::canonicalize(opCtx.get(), std::move(qr));
ASSERT_OK(statusWithCQ.getStatus());
@@ -4624,7 +4624,7 @@ TEST_F(QueryPlannerTest, CacheDataFromTaggedTreeFailsOnBadInput) {
TEST_F(QueryPlannerTest, TagAccordingToCacheFailsOnBadInput) {
const NamespaceString nss("test.collection");
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(BSON("a" << 3));
auto statusWithCQ = CanonicalQuery::canonicalize(opCtx.get(), std::move(qr));
ASSERT_OK(statusWithCQ.getStatus());
@@ -4653,7 +4653,7 @@ TEST_F(QueryPlannerTest, TagAccordingToCacheFailsOnBadInput) {
ASSERT_OK(s);
// Regenerate canonical query in order to clear tags.
- auto newQR = stdx::make_unique<QueryRequest>(nss);
+ auto newQR = std::make_unique<QueryRequest>(nss);
newQR->setFilter(BSON("a" << 3));
statusWithCQ = CanonicalQuery::canonicalize(opCtx.get(), std::move(newQR));
ASSERT_OK(statusWithCQ.getStatus());
diff --git a/src/mongo/db/query/query_planner_test_fixture.cpp b/src/mongo/db/query/query_planner_test_fixture.cpp
index 59306ff1feb..d96e3e822f0 100644
--- a/src/mongo/db/query/query_planner_test_fixture.cpp
+++ b/src/mongo/db/query/query_planner_test_fixture.cpp
@@ -308,7 +308,7 @@ void QueryPlannerTest::runQueryFull(const BSONObj& query,
const BSONObj& maxObj) {
clearState();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(query);
qr->setSort(sort);
qr->setProj(proj);
@@ -389,7 +389,7 @@ void QueryPlannerTest::runInvalidQueryFull(const BSONObj& query,
const BSONObj& maxObj) {
clearState();
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
qr->setFilter(query);
qr->setSort(sort);
qr->setProj(proj);
diff --git a/src/mongo/db/query/query_request.cpp b/src/mongo/db/query/query_request.cpp
index c43317b584b..5072c883430 100644
--- a/src/mongo/db/query/query_request.cpp
+++ b/src/mongo/db/query/query_request.cpp
@@ -31,6 +31,8 @@
#include "mongo/db/query/query_request.h"
+#include <memory>
+
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
#include "mongo/bson/simple_bsonobj_comparator.h"
@@ -40,7 +42,6 @@
#include "mongo/db/dbmessage.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/repl/read_concern_args.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/assert_util.h"
#include "mongo/util/str.h"
@@ -426,10 +427,10 @@ StatusWith<unique_ptr<QueryRequest>> QueryRequest::makeFromFindCommand(Namespace
BSONElement first = cmdObj.firstElement();
if (first.type() == BinData && first.binDataType() == BinDataType::newUUID) {
auto uuid = uassertStatusOK(UUID::parse(first));
- auto qr = stdx::make_unique<QueryRequest>(NamespaceStringOrUUID(nss.db().toString(), uuid));
+ auto qr = std::make_unique<QueryRequest>(NamespaceStringOrUUID(nss.db().toString(), uuid));
return parseFromFindCommand(std::move(qr), cmdObj, isExplain);
} else {
- auto qr = stdx::make_unique<QueryRequest>(nss);
+ auto qr = std::make_unique<QueryRequest>(nss);
return parseFromFindCommand(std::move(qr), cmdObj, isExplain);
}
}
@@ -765,7 +766,7 @@ bool QueryRequest::isValidSortOrder(const BSONObj& sortObj) {
// static
StatusWith<unique_ptr<QueryRequest>> QueryRequest::fromLegacyQueryMessage(const QueryMessage& qm) {
- auto qr = stdx::make_unique<QueryRequest>(NamespaceString(qm.ns));
+ auto qr = std::make_unique<QueryRequest>(NamespaceString(qm.ns));
Status status = qr->init(qm.ntoskip, qm.ntoreturn, qm.queryOptions, qm.query, qm.fields, true);
if (!status.isOK()) {
@@ -781,7 +782,7 @@ StatusWith<unique_ptr<QueryRequest>> QueryRequest::fromLegacyQuery(NamespaceStri
int ntoskip,
int ntoreturn,
int queryOptions) {
- auto qr = stdx::make_unique<QueryRequest>(nsOrUuid);
+ auto qr = std::make_unique<QueryRequest>(nsOrUuid);
Status status = qr->init(ntoskip, ntoreturn, queryOptions, queryObj, proj, true);
if (!status.isOK()) {
diff --git a/src/mongo/db/query/query_solution_test.cpp b/src/mongo/db/query/query_solution_test.cpp
index 7ac47cb2aad..5a143a5a5c5 100644
--- a/src/mongo/db/query/query_solution_test.cpp
+++ b/src/mongo/db/query/query_solution_test.cpp
@@ -31,6 +31,8 @@
#include "mongo/platform/basic.h"
+#include <memory>
+
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/json.h"
#include "mongo/db/query/collation/collator_interface_mock.h"
@@ -38,7 +40,6 @@
#include "mongo/db/query/index_entry.h"
#include "mongo/db/query/query_solution.h"
#include "mongo/db/query/query_test_service_context.h"
-#include "mongo/stdx/memory.h"
#include "mongo/unittest/unittest.h"
namespace {
@@ -737,7 +738,7 @@ auto createMatchExprAndParsedProjection(const BSONObj& query, const BSONObj& pro
TEST(QuerySolutionTest, InclusionProjectionPreservesSort) {
auto index = buildSimpleIndexEntry(BSON("a" << 1));
- auto node = stdx::make_unique<IndexScanNode>(index);
+ auto node = std::make_unique<IndexScanNode>(index);
BSONObj projection = BSON("a" << 1);
BSONObj match;
@@ -756,7 +757,7 @@ TEST(QuerySolutionTest, InclusionProjectionPreservesSort) {
TEST(QuerySolutionTest, ExclusionProjectionDoesNotPreserveSort) {
auto index = buildSimpleIndexEntry(BSON("a" << 1));
- auto node = stdx::make_unique<IndexScanNode>(index);
+ auto node = std::make_unique<IndexScanNode>(index);
BSONObj projection = BSON("a" << 0);
BSONObj match;
@@ -773,7 +774,7 @@ TEST(QuerySolutionTest, ExclusionProjectionDoesNotPreserveSort) {
}
TEST(QuerySolutionTest, InclusionProjectionTruncatesSort) {
- auto node = stdx::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b" << 1)));
+ auto node = std::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b" << 1)));
BSONObj projection = BSON("a" << 1);
BSONObj match;
@@ -791,7 +792,7 @@ TEST(QuerySolutionTest, InclusionProjectionTruncatesSort) {
}
TEST(QuerySolutionTest, ExclusionProjectionTruncatesSort) {
- auto node = stdx::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b" << 1)));
+ auto node = std::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b" << 1)));
BSONObj projection = BSON("b" << 0);
BSONObj match;
@@ -810,7 +811,7 @@ TEST(QuerySolutionTest, ExclusionProjectionTruncatesSort) {
TEST(QuerySolutionTest, NonMultikeyIndexWithoutPathLevelInfoCanCoverItsFields) {
auto node =
- stdx::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
+ std::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
node->index.multikey = false;
node->index.multikeyPaths = MultikeyPaths{};
ASSERT_TRUE(node->hasField("a"));
@@ -822,7 +823,7 @@ TEST(QuerySolutionTest, NonMultikeyIndexWithoutPathLevelInfoCanCoverItsFields) {
TEST(QuerySolutionTest, NonMultikeyIndexWithPathLevelInfoCanCoverItsFields) {
auto node =
- stdx::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
+ std::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
node->index.multikey = false;
node->index.multikeyPaths = MultikeyPaths{{}, {}};
ASSERT_TRUE(node->hasField("a"));
@@ -834,7 +835,7 @@ TEST(QuerySolutionTest, NonMultikeyIndexWithPathLevelInfoCanCoverItsFields) {
TEST(QuerySolutionTest, MultikeyIndexWithoutPathLevelInfoCannotCoverAnyFields) {
auto node =
- stdx::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
+ std::make_unique<IndexScanNode>(buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1)));
node->index.multikey = true;
node->index.multikeyPaths = MultikeyPaths{};
ASSERT_FALSE(node->hasField("a"));
@@ -845,7 +846,7 @@ TEST(QuerySolutionTest, MultikeyIndexWithoutPathLevelInfoCannotCoverAnyFields) {
}
TEST(QuerySolutionTest, MultikeyIndexWithPathLevelInfoCanCoverNonMultikeyFields) {
- auto node = stdx::make_unique<IndexScanNode>(
+ auto node = std::make_unique<IndexScanNode>(
buildSimpleIndexEntry(BSON("a" << 1 << "b" << 1 << "c" << 1)));
// Add metadata indicating that "b" is multikey.
@@ -859,7 +860,7 @@ TEST(QuerySolutionTest, MultikeyIndexWithPathLevelInfoCanCoverNonMultikeyFields)
}
TEST(QuerySolutionTest, MultikeyIndexCannotCoverFieldWithAnyMultikeyPathComponent) {
- auto node = stdx::make_unique<IndexScanNode>(
+ auto node = std::make_unique<IndexScanNode>(
buildSimpleIndexEntry(BSON("a" << 1 << "b.c.d" << 1 << "e" << 1)));
// Add metadata indicating that "b.c" is multikey.
diff --git a/src/mongo/db/query/query_test_service_context.cpp b/src/mongo/db/query/query_test_service_context.cpp
index a6088793f8e..c44836fa6be 100644
--- a/src/mongo/db/query/query_test_service_context.cpp
+++ b/src/mongo/db/query/query_test_service_context.cpp
@@ -31,15 +31,16 @@
#include "mongo/db/query/query_test_service_context.h"
+#include <memory>
+
#include "mongo/db/operation_context.h"
#include "mongo/db/query/collation/collator_factory_mock.h"
-#include "mongo/stdx/memory.h"
namespace mongo {
QueryTestServiceContext::QueryTestServiceContext()
: _service(ServiceContext::make()), _client(_service->makeClient("query_test")) {
- CollatorFactoryInterface::set(getServiceContext(), stdx::make_unique<CollatorFactoryMock>());
+ CollatorFactoryInterface::set(getServiceContext(), std::make_unique<CollatorFactoryMock>());
}
QueryTestServiceContext::~QueryTestServiceContext() = default;
diff --git a/src/mongo/db/query/stage_builder.cpp b/src/mongo/db/query/stage_builder.cpp
index 012efb8a262..ac2295c4985 100644
--- a/src/mongo/db/query/stage_builder.cpp
+++ b/src/mongo/db/query/stage_builder.cpp
@@ -33,6 +33,8 @@
#include "mongo/db/query/stage_builder.h"
+#include <memory>
+
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/database.h"
#include "mongo/db/catalog/index_catalog.h"
@@ -58,13 +60,11 @@
#include "mongo/db/index/fts_access_method.h"
#include "mongo/db/matcher/extensions_callback_real.h"
#include "mongo/db/s/collection_sharding_state.h"
-#include "mongo/stdx/memory.h"
#include "mongo/util/log.h"
namespace mongo {
using std::unique_ptr;
-using stdx::make_unique;
PlanStage* buildStages(OperationContext* opCtx,
const Collection* collection,
@@ -192,7 +192,7 @@ PlanStage* buildStages(OperationContext* opCtx,
}
case STAGE_AND_HASH: {
const AndHashNode* ahn = static_cast<const AndHashNode*>(root);
- auto ret = make_unique<AndHashStage>(opCtx, ws);
+ auto ret = std::make_unique<AndHashStage>(opCtx, ws);
for (size_t i = 0; i < ahn->children.size(); ++i) {
PlanStage* childStage =
buildStages(opCtx, collection, cq, qsol, ahn->children[i], ws);
@@ -205,7 +205,7 @@ PlanStage* buildStages(OperationContext* opCtx,
}
case STAGE_OR: {
const OrNode* orn = static_cast<const OrNode*>(root);
- auto ret = make_unique<OrStage>(opCtx, ws, orn->dedup, orn->filter.get());
+ auto ret = std::make_unique<OrStage>(opCtx, ws, orn->dedup, orn->filter.get());
for (size_t i = 0; i < orn->children.size(); ++i) {
PlanStage* childStage =
buildStages(opCtx, collection, cq, qsol, orn->children[i], ws);
@@ -218,7 +218,7 @@ PlanStage* buildStages(OperationContext* opCtx,
}
case STAGE_AND_SORTED: {
const AndSortedNode* asn = static_cast<const AndSortedNode*>(root);
- auto ret = make_unique<AndSortedStage>(opCtx, ws);
+ auto ret = std::make_unique<AndSortedStage>(opCtx, ws);
for (size_t i = 0; i < asn->children.size(); ++i) {
PlanStage* childStage =
buildStages(opCtx, collection, cq, qsol, asn->children[i], ws);
@@ -235,7 +235,7 @@ PlanStage* buildStages(OperationContext* opCtx,
params.dedup = msn->dedup;
params.pattern = msn->sort;
params.collator = cq.getCollator();
- auto ret = make_unique<MergeSortStage>(opCtx, params, ws);
+ auto ret = std::make_unique<MergeSortStage>(opCtx, params, ws);
for (size_t i = 0; i < msn->children.size(); ++i) {
PlanStage* childStage =
buildStages(opCtx, collection, cq, qsol, msn->children[i], ws);