summaryrefslogtreecommitdiff
path: root/src/mongo/s/shard_key_pattern_test.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-04-28 16:36:11 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-05-05 10:29:06 -0400
commitf7a46a118288ba0ce45c7664777ea0e89c2eb845 (patch)
treed9ba6c6981072ce4b836617ebb1889ac17e4fcc2 /src/mongo/s/shard_key_pattern_test.cpp
parentf49018bca41048d8a4f729ccc0489ea6be073a20 (diff)
downloadmongo-f7a46a118288ba0ce45c7664777ea0e89c2eb845.tar.gz
SERVER-23610 CanonicalQuery should own a CollatorInterface
Diffstat (limited to 'src/mongo/s/shard_key_pattern_test.cpp')
-rw-r--r--src/mongo/s/shard_key_pattern_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/s/shard_key_pattern_test.cpp b/src/mongo/s/shard_key_pattern_test.cpp
index 57cb7bca521..bb54fc289b5 100644
--- a/src/mongo/s/shard_key_pattern_test.cpp
+++ b/src/mongo/s/shard_key_pattern_test.cpp
@@ -29,6 +29,7 @@
#include "mongo/db/hasher.h"
#include "mongo/db/json.h"
+#include "mongo/db/query/query_test_service_context.h"
#include "mongo/unittest/unittest.h"
namespace {
@@ -249,7 +250,10 @@ TEST(ShardKeyPattern, ExtractDocShardKeyHashed) {
}
static BSONObj queryKey(const ShardKeyPattern& pattern, const BSONObj& query) {
- StatusWith<BSONObj> status = pattern.extractShardKeyFromQuery(query);
+ QueryTestServiceContext serviceContext;
+ auto txn = serviceContext.makeOperationContext();
+
+ StatusWith<BSONObj> status = pattern.extractShardKeyFromQuery(txn.get(), query);
if (!status.isOK())
return BSONObj();
return status.getValue();