diff options
author | Geert Bosch <geert@mongodb.com> | 2017-03-02 14:07:32 -0500 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-03-08 10:07:17 -0500 |
commit | 78052771af75f9c6fdff10796c82a38167274a6f (patch) | |
tree | 7fcfa87c45775dc86c86898501b2e06541ecd21b /src/mongo/dbtests/rollbacktests.cpp | |
parent | 54f3fff857ac66be0cdca5a4ddce9f87a0d80e6a (diff) | |
download | mongo-78052771af75f9c6fdff10796c82a38167274a6f.tar.gz |
SERVER-27987 Create and persist UUIDs for newly created collections
Diffstat (limited to 'src/mongo/dbtests/rollbacktests.cpp')
-rw-r--r-- | src/mongo/dbtests/rollbacktests.cpp | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/src/mongo/dbtests/rollbacktests.cpp b/src/mongo/dbtests/rollbacktests.cpp index 27982080d36..d9e70651178 100644 --- a/src/mongo/dbtests/rollbacktests.cpp +++ b/src/mongo/dbtests/rollbacktests.cpp @@ -72,7 +72,8 @@ void createCollection(OperationContext* opCtx, const NamespaceString& nss) { { WriteUnitOfWork uow(opCtx); ASSERT(!collectionExists(&ctx, nss.ns())); - ASSERT_OK(userCreateNS(opCtx, ctx.db(), nss.ns(), BSONObj(), false)); + ASSERT_OK(userCreateNS( + opCtx, ctx.db(), nss.ns(), BSONObj(), CollectionOptions::parseForCommand, false)); ASSERT(collectionExists(&ctx, nss.ns())); uow.commit(); } @@ -161,7 +162,8 @@ public: WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, ns)); auto options = capped ? BSON("capped" << true << "size" << 1000) : BSONObj(); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), ns, options, defaultIndexes)); + ASSERT_OK(userCreateNS( + &opCtx, ctx.db(), ns, options, CollectionOptions::parseForCommand, defaultIndexes)); ASSERT(collectionExists(&ctx, ns)); if (!rollback) { uow.commit(); @@ -192,7 +194,8 @@ public: WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, ns)); auto options = capped ? BSON("capped" << true << "size" << 1000) : BSONObj(); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), ns, options, defaultIndexes)); + ASSERT_OK(userCreateNS( + &opCtx, ctx.db(), ns, options, CollectionOptions::parseForCommand, defaultIndexes)); uow.commit(); } ASSERT(collectionExists(&ctx, ns)); @@ -236,7 +239,12 @@ public: WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, source.ns())); ASSERT(!collectionExists(&ctx, target.ns())); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), source.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + source.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); uow.commit(); } ASSERT(collectionExists(&ctx, source.ns())); @@ -288,8 +296,18 @@ public: WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, source.ns())); ASSERT(!collectionExists(&ctx, target.ns())); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), source.ns(), BSONObj(), defaultIndexes)); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), target.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + source.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + target.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); insertRecord(&opCtx, source, sourceDoc); insertRecord(&opCtx, target, targetDoc); @@ -348,7 +366,12 @@ public: { WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, nss.ns())); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), nss.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + nss.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); insertRecord(&opCtx, nss, oldDoc); uow.commit(); } @@ -361,7 +384,12 @@ public: WriteUnitOfWork uow(&opCtx); ASSERT_OK(ctx.db()->dropCollection(&opCtx, nss.ns())); ASSERT(!collectionExists(&ctx, nss.ns())); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), nss.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + nss.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); ASSERT(collectionExists(&ctx, nss.ns())); insertRecord(&opCtx, nss, newDoc); assertOnlyRecord(&opCtx, nss, newDoc); @@ -398,7 +426,12 @@ public: { WriteUnitOfWork uow(&opCtx); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), nss.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + nss.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); ASSERT(collectionExists(&ctx, nss.ns())); insertRecord(&opCtx, nss, doc); assertOnlyRecord(&opCtx, nss, doc); @@ -434,7 +467,12 @@ public: { WriteUnitOfWork uow(&opCtx); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), nss.ns(), BSONObj(), defaultIndexes)); + ASSERT_OK(userCreateNS(&opCtx, + ctx.db(), + nss.ns(), + BSONObj(), + CollectionOptions::parseForCommand, + defaultIndexes)); ASSERT(collectionExists(&ctx, nss.ns())); insertRecord(&opCtx, nss, doc); assertOnlyRecord(&opCtx, nss, doc); @@ -698,7 +736,8 @@ public: { WriteUnitOfWork uow(&opCtx); ASSERT(!collectionExists(&ctx, nss.ns())); - ASSERT_OK(userCreateNS(&opCtx, ctx.db(), nss.ns(), BSONObj(), false)); + ASSERT_OK(userCreateNS( + &opCtx, ctx.db(), nss.ns(), BSONObj(), CollectionOptions::parseForCommand, false)); ASSERT(collectionExists(&ctx, nss.ns())); Collection* coll = ctx.db()->getCollection(ns); IndexCatalog* catalog = coll->getIndexCatalog(); |