From 37e720678f6e468726c6cc775a5dc898d080f0f3 Mon Sep 17 00:00:00 2001 From: Charlie Swanson Date: Tue, 13 Dec 2016 10:15:08 -0500 Subject: SERVER-25535 Remove injectExpressionContext(). These methods were formally used to propagate a new ExpressionContext to stages, accumulators, or expressions which potentially needed to comparisons. Originally, this was necessary since Pipeline parsing happened outside of the collection lock and thus could not determine if there was a default collation on the collection. This meant that the collation could change after parsing and any operators that might compare strings would need to know about it. We have since moved parsing within the lock, so the collation can be known at parse time and the ExpressionContext should not change. This patch requires an ExpressionContext at construction time, and disallows changing the collation on an ExpressionContext. --- src/mongo/db/pipeline/parsed_exclusion_projection.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mongo/db/pipeline/parsed_exclusion_projection.h') diff --git a/src/mongo/db/pipeline/parsed_exclusion_projection.h b/src/mongo/db/pipeline/parsed_exclusion_projection.h index ea7b25ac33f..d0988d2d2cb 100644 --- a/src/mongo/db/pipeline/parsed_exclusion_projection.h +++ b/src/mongo/db/pipeline/parsed_exclusion_projection.h @@ -108,8 +108,8 @@ public: /** * Parses the projection specification given by 'spec', populating internal data structures. */ - void parse(const BSONObj& spec) final { - parse(spec, _root.get(), 0); + void parse(const boost::intrusive_ptr& expCtx, const BSONObj& spec) final { + parse(expCtx, spec, _root.get(), 0); } /** @@ -134,7 +134,10 @@ private: * Traverses 'spec' and parses each field. Adds any excluded fields at this level to 'node', * and recurses on any sub-objects. */ - void parse(const BSONObj& spec, ExclusionNode* node, size_t depth); + void parse(const boost::intrusive_ptr& expCtx, + const BSONObj& spec, + ExclusionNode* node, + size_t depth); // The ExclusionNode tree does most of the execution work once constructed. -- cgit v1.2.1