summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-04-28 21:21:00 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-29 01:49:00 +0000
commitee6112c32187870232a61b92663092bd8771561b (patch)
tree55e0f6ab38f60895472f503ead93b53f9af3fef1
parent1ff00ec66697eb16b6ae089681d9f3414f950fb1 (diff)
downloadmongo-ee6112c32187870232a61b92663092bd8771561b.tar.gz
SERVER-47123 remove AutoGetOrCreateDb from test command pinHistoryReplicated
-rw-r--r--src/mongo/db/commands/test_commands.cpp5
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();
}