diff options
author | Benety Goh <benety@mongodb.com> | 2021-06-03 12:52:54 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-03 17:23:40 +0000 |
commit | 561198923c21ae0fbf2f90dfb198494b9178fa15 (patch) | |
tree | d6418630e0e8a3fe21a3217346143c2373d4f850 /src/mongo/dbtests | |
parent | 6eb300dabe82f86cc91410e070d096be791f70e9 (diff) | |
download | mongo-561198923c21ae0fbf2f90dfb198494b9178fa15.tar.gz |
SERVER-57127 CountScanParams accepts CollectionPtr
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/query_stage_count_scan.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/src/mongo/dbtests/query_stage_count_scan.cpp b/src/mongo/dbtests/query_stage_count_scan.cpp index dc9a544bede..7485a938c01 100644 --- a/src/mongo/dbtests/query_stage_count_scan.cpp +++ b/src/mongo/dbtests/query_stage_count_scan.cpp @@ -100,8 +100,9 @@ public: } CountScanParams makeCountScanParams(OperationContext* opCtx, + const CollectionPtr& collection, const IndexDescriptor* descriptor) { - return {opCtx, descriptor}; + return {opCtx, collection, descriptor}; } static NamespaceString ns() { @@ -136,7 +137,8 @@ public: addIndex(BSON("a" << 1)); // Set up the count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("a" << 1); params.startKeyInclusive = true; params.endKey = BSON("a" << 10); @@ -167,7 +169,8 @@ public: addIndex(BSON("a" << 1)); // Set up the count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 3); params.startKeyInclusive = true; params.endKey = BSON("" << 7); @@ -198,7 +201,8 @@ public: addIndex(BSON("a" << 1)); // Set up the count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 3); params.startKeyInclusive = false; params.endKey = BSON("" << 7); @@ -225,7 +229,8 @@ public: addIndex(BSON("a" << 1)); // Set up count, and run - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 3); @@ -253,7 +258,8 @@ public: addIndex(BSON("a" << 1)); // Set up count, and run - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 3); @@ -282,7 +288,8 @@ public: addIndex(BSON("a" << 1)); // Set up count, and run - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 3); @@ -312,7 +319,8 @@ public: addIndex(BSON("a" << 1)); // Set up count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 6); @@ -365,7 +373,8 @@ public: addIndex(BSON("a" << 1)); // Set up count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 6); @@ -421,7 +430,8 @@ public: addIndex(BSON("a" << 1)); // Set up count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 2); params.startKeyInclusive = false; params.endKey = BSON("" << 6); @@ -484,7 +494,8 @@ public: remove(BSON("a" << 1 << "b" << 4)); // Ensure that count does not include unused keys - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 1); params.startKeyInclusive = true; params.endKey = BSON("" << 1); @@ -516,7 +527,8 @@ public: remove(BSON("a" << 1 << "b" << 9)); // Run count and check - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 0); params.startKeyInclusive = true; params.endKey = BSON("" << 2); @@ -545,7 +557,8 @@ public: addIndex(BSON("a" << 1)); // Set up count stage - auto params = makeCountScanParams(&_opCtx, getIndex(ctx.db(), BSON("a" << 1))); + auto params = + makeCountScanParams(&_opCtx, ctx.getCollection(), getIndex(ctx.db(), BSON("a" << 1))); params.startKey = BSON("" << 1); params.startKeyInclusive = true; params.endKey = BSON("" << 1); |