The $addFields aggregation stage exhibits unexpected behaviour for semantic_analysis::renamedPaths.
The renamedPaths function is supposed to return boost::none if any of the paths of interest are modified. For example, we expect boost::none for a {$project: {myPath: “$otherField”}} where myPath is the path of interest. Similarly, you would expect boost::none for {$addFields: {myPath: "$otherField”}} because the myPath field is overwritten. However, we actually get a {myPath -> myPath} map back for this case, which does not seem correct.
The purpose of this ticket is to investigate whether this is actually incorrect behaviour. If yes, all uses of renamedPaths (like for $exchange) should be checked for bugs.
- is related to
-
SERVER-55815 Renaming $set or $addFields incorrectly reports modified paths for optimizations
- Backlog