diff options
Diffstat (limited to 'src/mongo/db/commands/index_filter_commands_test.cpp')
-rw-r--r-- | src/mongo/db/commands/index_filter_commands_test.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mongo/db/commands/index_filter_commands_test.cpp b/src/mongo/db/commands/index_filter_commands_test.cpp index b1b7e7b7e29..760ccfbf9d2 100644 --- a/src/mongo/db/commands/index_filter_commands_test.cpp +++ b/src/mongo/db/commands/index_filter_commands_test.cpp @@ -130,12 +130,12 @@ void addQueryShapeToPlanCache(OperationContext* opCtx, const char* projectionStr, const char* collationStr) { // Create canonical query. - auto qr = std::make_unique<QueryRequest>(nss); - qr->setFilter(fromjson(queryStr)); - qr->setSort(fromjson(sortStr)); - qr->setProj(fromjson(projectionStr)); - qr->setCollation(fromjson(collationStr)); - auto statusWithCQ = CanonicalQuery::canonicalize(opCtx, std::move(qr)); + auto findCommand = std::make_unique<FindCommand>(nss); + findCommand->setFilter(fromjson(queryStr)); + findCommand->setSort(fromjson(sortStr)); + findCommand->setProjection(fromjson(projectionStr)); + findCommand->setCollation(fromjson(collationStr)); + auto statusWithCQ = CanonicalQuery::canonicalize(opCtx, std::move(findCommand)); ASSERT_OK(statusWithCQ.getStatus()); std::unique_ptr<CanonicalQuery> cq = std::move(statusWithCQ.getValue()); @@ -161,12 +161,12 @@ bool planCacheContains(OperationContext* opCtx, const char* collationStr) { // Create canonical query. - auto qr = std::make_unique<QueryRequest>(nss); - qr->setFilter(fromjson(queryStr)); - qr->setSort(fromjson(sortStr)); - qr->setProj(fromjson(projectionStr)); - qr->setCollation(fromjson(collationStr)); - auto statusWithInputQuery = CanonicalQuery::canonicalize(opCtx, std::move(qr)); + auto findCommand = std::make_unique<FindCommand>(nss); + findCommand->setFilter(fromjson(queryStr)); + findCommand->setSort(fromjson(sortStr)); + findCommand->setProjection(fromjson(projectionStr)); + findCommand->setCollation(fromjson(collationStr)); + auto statusWithInputQuery = CanonicalQuery::canonicalize(opCtx, std::move(findCommand)); ASSERT_OK(statusWithInputQuery.getStatus()); unique_ptr<CanonicalQuery> inputQuery = std::move(statusWithInputQuery.getValue()); @@ -181,12 +181,12 @@ bool planCacheContains(OperationContext* opCtx, // Canonicalize the query shape stored in the cache entry in order to get the plan cache // key. - auto qr = std::make_unique<QueryRequest>(nss); - qr->setFilter(createdFromQuery.filter); - qr->setSort(createdFromQuery.sort); - qr->setProj(createdFromQuery.projection); - qr->setCollation(createdFromQuery.collation); - auto statusWithCurrentQuery = CanonicalQuery::canonicalize(opCtx, std::move(qr)); + auto findCommand = std::make_unique<FindCommand>(nss); + findCommand->setFilter(createdFromQuery.filter); + findCommand->setSort(createdFromQuery.sort); + findCommand->setProjection(createdFromQuery.projection); + findCommand->setCollation(createdFromQuery.collation); + auto statusWithCurrentQuery = CanonicalQuery::canonicalize(opCtx, std::move(findCommand)); ASSERT_OK(statusWithCurrentQuery.getStatus()); unique_ptr<CanonicalQuery> currentQuery = std::move(statusWithCurrentQuery.getValue()); |