diff options
author | Benety Goh <benety@mongodb.com> | 2021-04-28 21:21:00 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-29 01:49:00 +0000 |
commit | ee6112c32187870232a61b92663092bd8771561b (patch) | |
tree | 55e0f6ab38f60895472f503ead93b53f9af3fef1 | |
parent | 1ff00ec66697eb16b6ae089681d9f3414f950fb1 (diff) | |
download | mongo-ee6112c32187870232a61b92663092bd8771561b.tar.gz |
SERVER-47123 remove AutoGetOrCreateDb from test command pinHistoryReplicated
-rw-r--r-- | src/mongo/db/commands/test_commands.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 6ee4a5b7849..e8a6481d589 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -258,7 +258,7 @@ public: const Timestamp requestedPinTs = cmdObj.firstElement().timestamp(); const bool round = cmdObj["round"].booleanSafe(); - AutoGetOrCreateDb db(opCtx, kDurableHistoryTestNss.db(), MODE_IX); + AutoGetDb autoDb(opCtx, kDurableHistoryTestNss.db(), MODE_IX); Lock::CollectionLock collLock(opCtx, kDurableHistoryTestNss, MODE_IX); if (!CollectionCatalog::get(opCtx)->lookupCollectionByNamespace( opCtx, @@ -266,8 +266,9 @@ public: uassertStatusOK(userAllowedCreateNS(opCtx, kDurableHistoryTestNss)); WriteUnitOfWork wuow(opCtx); CollectionOptions defaultCollectionOptions; + auto db = autoDb.ensureDbExists(); uassertStatusOK( - db.getDb()->userCreateNS(opCtx, kDurableHistoryTestNss, defaultCollectionOptions)); + db->userCreateNS(opCtx, kDurableHistoryTestNss, defaultCollectionOptions)); wuow.commit(); } |