diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2023-02-15 14:12:23 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-15 15:41:49 +0000 |
commit | c3a54fa12ceb2e4e7b5fad5bd117bbab9b9c486f (patch) | |
tree | 26e1b286c300deb75b72e1747900c39347415aca /src/mongo/db/introspect.cpp | |
parent | 8f36c90d997708507e1d73c4200d79a92619f422 (diff) | |
download | mongo-c3a54fa12ceb2e4e7b5fad5bd117bbab9b9c486f.tar.gz |
SERVER-73818 Remove CollectionPtr from CollectionCatalog interface
Interfaces instead return 'const Collection*' and if a CollectionPtr is needed it must be created by the user.
Diffstat (limited to 'src/mongo/db/introspect.cpp')
-rw-r--r-- | src/mongo/db/introspect.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp index 7973c81b227..fed02af17e5 100644 --- a/src/mongo/db/introspect.cpp +++ b/src/mongo/db/introspect.cpp @@ -119,8 +119,8 @@ void profile(OperationContext* opCtx, NetworkOp op) { } uassertStatusOK(createProfileCollection(newCtx.get(), db)); - auto coll = CollectionCatalog::get(newCtx.get()) - ->lookupCollectionByNamespace(newCtx.get(), dbProfilingNS); + CollectionPtr coll(CollectionCatalog::get(newCtx.get()) + ->lookupCollectionByNamespace(newCtx.get(), dbProfilingNS)); WriteUnitOfWork wuow(newCtx.get()); OpDebug* const nullOpDebug = nullptr; @@ -149,7 +149,7 @@ Status createProfileCollection(OperationContext* opCtx, Database* db) { // collection creation would endlessly throw errors because the collection exists: must check // and see the collection exists in order to break free. return writeConflictRetry(opCtx, "createProfileCollection", dbProfilingNS.ns(), [&] { - const CollectionPtr collection = + const Collection* collection = CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, dbProfilingNS); if (collection) { if (!collection->isCapped()) { |