diff options
author | Misha Ivkov <misha.ivkov@10gen.com> | 2019-07-26 09:45:17 -0400 |
---|---|---|
committer | Misha Ivkov <misha.ivkov@10gen.com> | 2019-08-08 09:35:31 -0400 |
commit | e911ae3b0e1eba1339cbfa90d49a3daccd304e16 (patch) | |
tree | b502fa4ffade59d0cdb391deeeac8ad4b93c1c0d /src/mongo/db/query/canonical_query.cpp | |
parent | 5057974733dd260edc5a07ef4d43a78338f8143a (diff) | |
download | mongo-e911ae3b0e1eba1339cbfa90d49a3daccd304e16.tar.gz |
SERVER-42298 Use SortPattern in the implementation of SortKeyGenerator
Diffstat (limited to 'src/mongo/db/query/canonical_query.cpp')
-rw-r--r-- | src/mongo/db/query/canonical_query.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/query/canonical_query.cpp b/src/mongo/db/query/canonical_query.cpp index 03424a838d6..e0a164bd2a2 100644 --- a/src/mongo/db/query/canonical_query.cpp +++ b/src/mongo/db/query/canonical_query.cpp @@ -205,7 +205,7 @@ StatusWith<std::unique_ptr<CanonicalQuery>> CanonicalQuery::canonicalize( // Make the CQ we'll hopefully return. std::unique_ptr<CanonicalQuery> cq(new CanonicalQuery()); Status initStatus = cq->init(opCtx, - nullptr, // no expression context + baseQuery.getExpCtx(), std::move(qr), baseQuery.canHaveNoopMatchNodes(), root->shallowClone(), @@ -261,6 +261,9 @@ void CanonicalQuery::setCollator(std::unique_ptr<CollatorInterface> collator) { // the object owned by '_collator'. We must associate the match expression tree with the new // value of '_collator'. _root->setCollator(_collator.get()); + + // In a similar vein, we must give the ExpressionContext the same collator. + _expCtx->setCollator(_collator.get()); } // static |