When the SBE stage builder creates an SBE for a QuerySolution tree where a SORT happens before FETCH, the resulting plan is incorrect and fails, probably during the prepare() step with an "undefined slot accessor" error. It appears that we are attempting to use a bogus slot id (note the "s7564601" in the SBE plan below).
After looking at this with justin.seyster, we are guessing that the slot id comes from assuming that _data.resultSlot was initialized by buildFetch(), but in this scenario buildFetch() hasn't been called yet.
- related to
-
SERVER-50638 Fix invariant failure in SlotBasedStageBuilder::buildOr()
- Closed