diff options
author | Martin Neupauer <martin.neupauer@mongodb.com> | 2019-08-29 13:22:09 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-29 13:22:09 +0000 |
commit | 3cdbdedce431fbc71a5eb89b689268e783d73bd4 (patch) | |
tree | 327109bb734c91384f13f5acee6b71c917ea1fd3 /src/mongo/dbtests/query_stage_sort.cpp | |
parent | ffd486c3ff049abc9f8a2c76b3e2b9dea970c19b (diff) | |
download | mongo-3cdbdedce431fbc71a5eb89b689268e783d73bd4.tar.gz |
SERVER-42181 Make WorkingSetMember hold Document instead of BSONObj
SERVER-42157 Unowned mode for Document/Value
Diffstat (limited to 'src/mongo/dbtests/query_stage_sort.cpp')
-rw-r--r-- | src/mongo/dbtests/query_stage_sort.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp index 0919fdea1ad..dcf7687ded7 100644 --- a/src/mongo/dbtests/query_stage_sort.cpp +++ b/src/mongo/dbtests/query_stage_sort.cpp @@ -98,7 +98,8 @@ public: WorkingSetID id = ws->allocate(); WorkingSetMember* member = ws->get(id); member->recordId = *it; - member->obj = coll->docFor(&_opCtx, *it); + auto snapshotBson = coll->docFor(&_opCtx, *it); + member->doc = {snapshotBson.snapshotId(), Document{snapshotBson.value()}}; ws->transitionToRecordIdAndObj(id); ms->pushBack(id); } @@ -403,10 +404,10 @@ public: } WorkingSetMember* member = exec->getWorkingSet()->get(id); ASSERT(member->hasObj()); - if (member->obj.value().getField("_id").OID() == updatedId) { - ASSERT(idBeforeUpdate == member->obj.snapshotId()); + if (member->doc.value().getField("_id").getOid() == updatedId) { + ASSERT(idBeforeUpdate == member->doc.snapshotId()); } - thisVal = member->obj.value().getField("foo").Int(); + thisVal = member->doc.value().getField("foo").getInt(); ASSERT_LTE(lastVal, thisVal); // Expect docs in range [0, limit) ASSERT_LTE(0, thisVal); @@ -541,15 +542,16 @@ public: { WorkingSetID id = ws->allocate(); WorkingSetMember* member = ws->get(id); - member->obj = Snapshotted<BSONObj>( - SnapshotId(), fromjson("{a: [1,2,3], b:[1,2,3], c:[1,2,3], d:[1,2,3,4]}")); + member->doc = { + SnapshotId(), + Document{fromjson("{a: [1,2,3], b:[1,2,3], c:[1,2,3], d:[1,2,3,4]}")}}; member->transitionToOwnedObj(); queuedDataStage->pushBack(id); } { WorkingSetID id = ws->allocate(); WorkingSetMember* member = ws->get(id); - member->obj = Snapshotted<BSONObj>(SnapshotId(), fromjson("{a:1, b:1, c:1}")); + member->doc = {SnapshotId(), Document{fromjson("{a:1, b:1, c:1}")}}; member->transitionToOwnedObj(); queuedDataStage->pushBack(id); } |