summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_count.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2015-02-02 15:39:22 -0500
committerEliot Horowitz <eliot@10gen.com>2015-02-02 15:40:16 -0500
commitd46a5c78c0d046f1975aca2eaa7f055a713c720f (patch)
treee694224fd2802cdbeecde7d87b5983d19bc49f31 /src/mongo/dbtests/query_stage_count.cpp
parent87f1334585928a2b86407f68ecb6b35c62855b24 (diff)
downloadmongo-d46a5c78c0d046f1975aca2eaa7f055a713c720f.tar.gz
SERVER-17132: Added SnapshotId and Snapshotted and use them in query to make sure we use correct versions of docs
Diffstat (limited to 'src/mongo/dbtests/query_stage_count.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index 63a4649ae83..f100a8901f1 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -123,7 +123,9 @@ namespace QueryStageCount {
void update(const RecordId& oldLoc, const BSONObj& newDoc) {
WriteUnitOfWork wunit(&_txn);
BSONObj oldDoc = _coll->getRecordStore()->dataFor( &_txn, oldLoc ).releaseToBson();
- _coll->updateDocument(&_txn, oldLoc, oldDoc, newDoc, false, true, NULL);
+ _coll->updateDocument(&_txn, oldLoc,
+ Snapshotted<BSONObj>(_txn.recoveryUnit()->getSnapshotId(), oldDoc),
+ newDoc, false, true, NULL);
wunit.commit();
}
@@ -314,11 +316,11 @@ namespace QueryStageCount {
void interject(CountStage& count_stage, int interjection) {
if (interjection == 0) {
count_stage.invalidate(&_txn, _locs[0], INVALIDATION_MUTATION);
- OID id1 = _coll->docFor(&_txn, _locs[0]).getField("_id").OID();
+ OID id1 = _coll->docFor(&_txn, _locs[0]).value().getField("_id").OID();
update(_locs[0], BSON("_id" << id1 << "x" << 100));
count_stage.invalidate(&_txn, _locs[1], INVALIDATION_MUTATION);
- OID id2 = _coll->docFor(&_txn, _locs[1]).getField("_id").OID();
+ OID id2 = _coll->docFor(&_txn, _locs[1]).value().getField("_id").OID();
update(_locs[1], BSON("_id" << id2 << "x" << 100));
}
}