diff options
author | Geert Bosch <geert@mongodb.com> | 2017-06-15 00:20:33 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-06-23 15:11:09 -0400 |
commit | a69ae445303fc4821c6745866b3902623a385c1c (patch) | |
tree | 177cab03d8078defe675fd0dff15349cc32401c0 /src/mongo/dbtests/rollbacktests.cpp | |
parent | 3bb0f6030b5609002049ea2156e97fe4c6c05d5d (diff) | |
download | mongo-a69ae445303fc4821c6745866b3902623a385c1c.tar.gz |
SERVER-27992 Use UUIDs for replication
Diffstat (limited to 'src/mongo/dbtests/rollbacktests.cpp')
-rw-r--r-- | src/mongo/dbtests/rollbacktests.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/mongo/dbtests/rollbacktests.cpp b/src/mongo/dbtests/rollbacktests.cpp index 71f1a89a8ff..3cab6c741ab 100644 --- a/src/mongo/dbtests/rollbacktests.cpp +++ b/src/mongo/dbtests/rollbacktests.cpp @@ -32,8 +32,10 @@ #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database_catalog_entry.h" #include "mongo/db/catalog/database_holder.h" +#include "mongo/db/catalog/drop_collection.h" #include "mongo/db/catalog/head_manager.h" #include "mongo/db/catalog/index_create.h" +#include "mongo/db/catalog/rename_collection.h" #include "mongo/db/client.h" #include "mongo/db/db_raii.h" #include "mongo/db/index/index_descriptor.h" @@ -80,8 +82,7 @@ Status renameCollection(OperationContext* opCtx, const NamespaceString& source, const NamespaceString& target) { ASSERT_EQ(source.db(), target.db()); - Database* db = dbHolder().get(opCtx, source.db()); - return db->renameCollection(opCtx, source.ns(), target.ns(), false); + return renameCollection(opCtx, source, target, false, false); } Status truncateCollection(OperationContext* opCtx, const NamespaceString& nss) { Collection* coll = dbHolder().get(opCtx, nss.db())->getCollection(opCtx, nss); @@ -317,7 +318,13 @@ public: { WriteUnitOfWork uow(&opCtx); - ASSERT_OK(ctx.db()->dropCollection(&opCtx, target.ns())); + BSONObjBuilder result; + ASSERT_OK( + dropCollection(&opCtx, + target, + result, + {}, + DropCollectionSystemCollectionMode::kDisallowSystemCollectionDrops)); ASSERT_OK(renameCollection(&opCtx, source, target)); ASSERT(!collectionExists(&ctx, source.ns())); ASSERT(collectionExists(&ctx, target.ns())); @@ -375,7 +382,13 @@ public: { WriteUnitOfWork uow(&opCtx); - ASSERT_OK(ctx.db()->dropCollection(&opCtx, nss.ns())); + BSONObjBuilder result; + ASSERT_OK( + dropCollection(&opCtx, + nss, + result, + {}, + DropCollectionSystemCollectionMode::kDisallowSystemCollectionDrops)); ASSERT(!collectionExists(&ctx, nss.ns())); ASSERT_OK(userCreateNS(&opCtx, ctx.db(), @@ -428,7 +441,13 @@ public: insertRecord(&opCtx, nss, doc); assertOnlyRecord(&opCtx, nss, doc); - ASSERT_OK(ctx.db()->dropCollection(&opCtx, nss.ns())); + BSONObjBuilder result; + ASSERT_OK( + dropCollection(&opCtx, + nss, + result, + {}, + DropCollectionSystemCollectionMode::kDisallowSystemCollectionDrops)); ASSERT(!collectionExists(&ctx, nss.ns())); if (!rollback) { |