diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2023-02-09 12:08:10 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-13 16:55:03 +0000 |
commit | 78b5bb22426142e49b30c91cff0f1b6e99725047 (patch) | |
tree | 7412d4ee181a221884e52126e460eeb40b895776 /src/mongo/db/query | |
parent | 13e038d492a20bb52c7f3322603815f503020cf5 (diff) | |
download | mongo-78b5bb22426142e49b30c91cff0f1b6e99725047.tar.gz |
SERVER-73780 Make CollectionPtr constructor explicit
Diffstat (limited to 'src/mongo/db/query')
-rw-r--r-- | src/mongo/db/query/cqf_command_utils.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/query/cqf_get_executor.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/query/cqf_command_utils.cpp b/src/mongo/db/query/cqf_command_utils.cpp index 9cb861a8695..55a8987acec 100644 --- a/src/mongo/db/query/cqf_command_utils.cpp +++ b/src/mongo/db/query/cqf_command_utils.cpp @@ -1053,7 +1053,7 @@ bool isEligibleCommon(const RequestType& request, request.getLegacyRuntimeConstants(); bool unsupportedIndexType = [&]() { - if (collection == nullptr) + if (!collection) return false; const IndexCatalog& indexCatalog = *collection->getIndexCatalog(); @@ -1079,7 +1079,7 @@ bool isEligibleCommon(const RequestType& request, }(); bool unsupportedCollectionType = [&]() { - if (collection == nullptr) + if (!collection) return false; if (collection->isClustered() || !collection->getCollectionOptions().collation.isEmpty() || diff --git a/src/mongo/db/query/cqf_get_executor.cpp b/src/mongo/db/query/cqf_get_executor.cpp index 08ec36e6839..c031770a454 100644 --- a/src/mongo/db/query/cqf_get_executor.cpp +++ b/src/mongo/db/query/cqf_get_executor.cpp @@ -376,7 +376,7 @@ static void populateAdditionalScanDefs( // multi-collection queries. AutoGetCollectionForReadCommandMaybeLockFree ctx(opCtx, involvedNss); const CollectionPtr& collection = ctx ? ctx.getCollection() : CollectionPtr::null; - const bool collectionExists = collection != nullptr; + const bool collectionExists = static_cast<bool>(collection); const std::string uuidStr = collectionExists ? collection->uuid().toString() : "<missing_uuid>"; const std::string collNameStr = involvedNss.coll().toString(); @@ -504,7 +504,7 @@ Metadata populateMetadata(boost::intrusive_ptr<ExpressionContext> expCtx, QueryHints& queryHints, PrefixId& prefixId) { auto opCtx = expCtx->opCtx; - const bool collectionExists = collection != nullptr; + const bool collectionExists = static_cast<bool>(collection); // Add the base collection metadata. opt::unordered_map<std::string, optimizer::IndexDefinition> indexDefs; @@ -660,7 +660,7 @@ std::unique_ptr<PlanExecutor, PlanExecutor::Deleter> getSBEExecutorViaCascadesOp validateCommandOptions(canonicalQuery.get(), collection, indexHint, involvedCollections); const bool requireRID = canonicalQuery ? canonicalQuery->getForceGenerateRecordId() : false; - const bool collectionExists = collection != nullptr; + const bool collectionExists = static_cast<bool>(collection); const std::string uuidStr = collectionExists ? collection->uuid().toString() : "<missing_uuid>"; const std::string collNameStr = nss.coll().toString(); const std::string scanDefName = collNameStr + "_" + uuidStr; |