summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_count.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2016-04-19 10:30:08 -0400
committerAndy Schwerin <schwerin@mongodb.com>2016-04-20 09:55:59 -0400
commit74280dd7b600c51f01e28e137a73f61fc0d0a2a2 (patch)
tree95dfe535377fe297b2098b9365a522b50f1f5c1f /src/mongo/dbtests/query_stage_count.cpp
parent22082d01a15a589398f3db6f9357dedd1a4c73fe (diff)
downloadmongo-74280dd7b600c51f01e28e137a73f61fc0d0a2a2.tar.gz
SERVER-23779 Replace direct instantiation of OperationContextImpl with cc().makeOperationContext().
Also, make OperationContextImpl's constructor private so that it can only be constructed via a Client.
Diffstat (limited to 'src/mongo/dbtests/query_stage_count.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_count.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp
index cfdcf6ffab8..de3d484dbaa 100644
--- a/src/mongo/dbtests/query_stage_count.cpp
+++ b/src/mongo/dbtests/query_stage_count.cpp
@@ -28,6 +28,9 @@
#include <memory>
+#include "mongo/platform/basic.h"
+
+#include "mongo/db/client.h"
#include "mongo/db/db_raii.h"
#include "mongo/db/exec/collection_scan.h"
#include "mongo/db/exec/collection_scan_common.h"
@@ -38,7 +41,6 @@
#include "mongo/db/matcher/expression.h"
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/db/matcher/extensions_callback_disallow_extensions.h"
-#include "mongo/db/operation_context_impl.h"
#include "mongo/dbtests/dbtests.h"
namespace QueryStageCount {
@@ -52,8 +54,7 @@ const int kInterjections = kDocuments;
class CountStageTest {
public:
CountStageTest()
- : _txn(),
- _scopedXact(&_txn, MODE_IX),
+ : _scopedXact(&_txn, MODE_IX),
_dbLock(_txn.lockState(), nsToDatabaseSubstring(ns()), MODE_X),
_ctx(&_txn, ns()),
_coll(NULL) {}
@@ -224,7 +225,8 @@ public:
protected:
vector<RecordId> _recordIds;
- OperationContextImpl _txn;
+ const ServiceContext::UniqueOperationContext _txnPtr = cc().makeOperationContext();
+ OperationContext& _txn = *_txnPtr;
ScopedTransaction _scopedXact;
Lock::DBLock _dbLock;
OldClientContext _ctx;