-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The exhaustiveScope of a deep path $set when a prior, shorter path exists (the shadowing case) is incorrect.
This is follow up from SERVER-131449, which grew in scope too much, so this bug fix was split up (see [vesko/SERVER-131449-Fix-up-exhausiveScope-in-the-shadowing-case](https://github.com/10gen/mongo/pull/60571)).
The exhaustive scope selection should check for a missing parent embedded scope before falling back to the previous field's exhaustive scope. When the parent's embedded scope is not inherited, the new scope is its own exhaustive scope. Right now it can incorrectly inherit an ancestor's exhaustive scope.
This is actually evident in the golden tests we have.
In ComplexPaths, we have the pipeline:
[{$set: { a: 1, b: 1, 'c.c': 1 }},
{$set: { 'a.a': 1, 'a.b': 1, 'b.b.b': 1, c: 1 }},
{$set: { 'a.b.a': 1, 'b.b': 1, 'b.a': 1 }}]
And for the fields for 'b.b.b', and the second 'b's, exhaustiveScope is set to that of the parent (it's clear from the golden test).
The impact of this is likely small for the existing path arrayness case, I cannot actually establish how this could create an issue right now. But for type inference it endsĀ up with an incorrect "missing or array" type.
- is related to
-
SERVER-131449 Dependency graph loses nested path arrayness after later $project of collection field
-
- Closed
-