diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-08-01 09:35:39 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-08-16 16:28:02 -0400 |
commit | 40036f67d0c15e2cd319e82f8c6a1e691fb74806 (patch) | |
tree | fd9744b756fb092c47c1b3fbcd15e349fe0e270a /src/mongo/dbtests/query_stage_sort.cpp | |
parent | 53a9b329fbf1a6d8b620fee2cbb2ef1c27ddd3f3 (diff) | |
download | mongo-40036f67d0c15e2cd319e82f8c6a1e691fb74806.tar.gz |
SERVER-30580 No more status locations
Diffstat (limited to 'src/mongo/dbtests/query_stage_sort.cpp')
-rw-r--r-- | src/mongo/dbtests/query_stage_sort.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/dbtests/query_stage_sort.cpp b/src/mongo/dbtests/query_stage_sort.cpp index bb9082c81fb..2c698748b6c 100644 --- a/src/mongo/dbtests/query_stage_sort.cpp +++ b/src/mongo/dbtests/query_stage_sort.cpp @@ -350,18 +350,19 @@ public: set<RecordId>::iterator it = recordIds.begin(); Snapshotted<BSONObj> oldDoc = coll->docFor(&_opCtx, *it); - OID updatedId = oldDoc.value().getField("_id").OID(); - SnapshotId idBeforeUpdate = oldDoc.snapshotId(); + const OID updatedId = oldDoc.value().getField("_id").OID(); + const SnapshotId idBeforeUpdate = oldDoc.snapshotId(); // We purposefully update the document to have a 'foo' value greater than limit(). // This allows us to check that we don't return the new copy of a doc by asserting // foo < limit(). - BSONObj newDoc = BSON("_id" << updatedId << "foo" << limit() + 10); + auto newDoc = [&](const Snapshotted<BSONObj>& oldDoc) { + return BSON("_id" << oldDoc.value()["_id"] << "foo" << limit() + 10); + }; OplogUpdateEntryArgs args; args.nss = coll->ns(); { WriteUnitOfWork wuow(&_opCtx); - coll->updateDocument(&_opCtx, *it, oldDoc, newDoc, false, false, NULL, &args) - .status_with_transitional_ignore(); + coll->updateDocument(&_opCtx, *it, oldDoc, newDoc(oldDoc), false, false, NULL, &args); wuow.commit(); } exec->restoreState(); @@ -379,8 +380,8 @@ public: oldDoc = coll->docFor(&_opCtx, *it); { WriteUnitOfWork wuow(&_opCtx); - coll->updateDocument(&_opCtx, *it++, oldDoc, newDoc, false, false, NULL, &args) - .status_with_transitional_ignore(); + coll->updateDocument( + &_opCtx, *it++, oldDoc, newDoc(oldDoc), false, false, NULL, &args); wuow.commit(); } } |