-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
$replaceRoot and $replaceWith must fail when the new root is not a document, even when no later stage reads the new root. With featureFlagSbeBlueprintRewrites on, SBE blueprint dead slot elimination removes the unread new-root entry and the check with it, so on {{
{x: 1}}} the pipeline [{$replaceWith: "$x"}, {$replaceWith: {ok: 1}}] returns {{
{ok: 1}}} instead of failing.
- Mark the new-root slot with SbBlueprint::keepSlot() in buildReplaceRoot(), as the sort's parallel arrays check already is
- Add a jstest that fails on such pipelines without the fix