-
Type: Task
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Execution
-
None
-
Query Execution
This invariant is firing in the visit overload for ExpressionFilter during translation of a $filter during work in SERVER-32739.
https://github.com/10gen/mongo/blob/master/src/mongo/db/query/sbe_stage_builder_expression.cpp#L522
A possible explanation for this is that the expression walker will make the following calls since $filter has multiple children,
preVisit(), inVisit(), inVisit(), postVisit.
On the first inVisit() call we pull the variableId from the ExpressionFilter instance that we are translating, and stick it in _context->environment. Then on the second inVisit call we pull the same variableId from the ExpressionFilter instance and since we have already inserted the variableId into the environment, we trip the invariant.
This work should support translation of a limit expression in $filter.
- is depended on by
-
SERVER-32739 allow limit in $filter expression
- Closed