diff options
Diffstat (limited to 'src/mongo/db/commands/test_commands.cpp')
-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(); } |