diff options
author | Louis Williams <louis.williams@mongodb.com> | 2021-04-09 14:05:18 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-09 19:03:34 +0000 |
commit | da7c4d8cdc446b50826455fbd20c08b55b31e897 (patch) | |
tree | d396ee39a185e53a6afb2da8c3f386a54232e261 /src/mongo/dbtests/query_stage_collscan.cpp | |
parent | 61d796c8dd5b25521e273fcb2d88cd91e37688d6 (diff) | |
download | mongo-da7c4d8cdc446b50826455fbd20c08b55b31e897.tar.gz |
SERVER-55779 Clustered collections should store RecordIds as KeyString
Diffstat (limited to 'src/mongo/dbtests/query_stage_collscan.cpp')
-rw-r--r-- | src/mongo/dbtests/query_stage_collscan.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp index a79f93c7be2..31da0fd9220 100644 --- a/src/mongo/dbtests/query_stage_collscan.cpp +++ b/src/mongo/dbtests/query_stage_collscan.cpp @@ -48,6 +48,7 @@ #include "mongo/db/matcher/expression_parser.h" #include "mongo/db/namespace_string.h" #include "mongo/db/query/plan_executor_factory.h" +#include "mongo/db/record_id_helpers.h" #include "mongo/db/storage/record_store.h" #include "mongo/dbtests/dbtests.h" #include "mongo/unittest/unittest.h" @@ -600,8 +601,8 @@ TEST_F(QueryStageCollectionScanTest, QueryTestCollscanClusteredNonExistentRecord params.tailable = false; // Use RecordIds that don't exist. Expect to see all records. - params.minRecord = RecordId(OID().view().view(), OID::kOIDSize); - params.maxRecord = RecordId(OID::max().view().view(), OID::kOIDSize); + params.minRecord = record_id_helpers::keyForOID(OID()); + params.maxRecord = record_id_helpers::keyForOID(OID::max()); WorkingSet ws; auto scan = std::make_unique<CollectionScan>(_expCtx.get(), coll, params, &ws, nullptr); @@ -708,9 +709,10 @@ TEST_F(QueryStageCollectionScanTest, QueryTestCollscanClusteredInnerRangeExclusi // Provide RecordId bounds with exclusive filters. StatusWithMatchExpression swMatch = MatchExpressionParser::parse( - fromjson(fmt::sprintf("{_id: {$gt: ObjectId('%s'), $lt: ObjectId('%s')}}", - params.minRecord->toString(), - params.maxRecord->toString())), + fromjson(fmt::sprintf( + "{_id: {$gt: ObjectId('%s'), $lt: ObjectId('%s')}}", + record_id_helpers::toBSONAs(*params.minRecord, "").firstElement().OID().toString(), + record_id_helpers::toBSONAs(*params.maxRecord, "").firstElement().OID().toString())), _expCtx.get()); ASSERT_OK(swMatch.getStatus()); auto filter = std::move(swMatch.getValue()); @@ -772,9 +774,10 @@ TEST_F(QueryStageCollectionScanTest, QueryTestCollscanClusteredInnerRangeExclusi // Provide RecordId bounds with exclusive filters. StatusWithMatchExpression swMatch = MatchExpressionParser::parse( - fromjson(fmt::sprintf("{_id: {$gt: ObjectId('%s'), $lt: ObjectId('%s')}}", - params.minRecord->toString(), - params.maxRecord->toString())), + fromjson(fmt::sprintf( + "{_id: {$gt: ObjectId('%s'), $lt: ObjectId('%s')}}", + record_id_helpers::toBSONAs(*params.minRecord, "").firstElement().OID().toString(), + record_id_helpers::toBSONAs(*params.maxRecord, "").firstElement().OID().toString())), _expCtx.get()); ASSERT_OK(swMatch.getStatus()); auto filter = std::move(swMatch.getValue()); |