Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
QO 2022-09-05, QO 2022-09-19
Description
findOne() is an internal C++ helper function which constructs a PlanExecutor and invokes getNext() with the RecordId out-param. Note that the find implementation never sets this parameter.
When a CQF-eligible query uses the findOne() helper, such as in the codepath to drop a view, the SBE plan executor hits an invariant during the getNext() call that the output recordId slot is not set.
SERVER-62407 introduced a temporary bit to CanonicalQuery to avoid using CQF in the findOne codepath. This ticket tracks the work to allow SBE plans generated via CQF to output the RecordId slot, allowing the findOne() codepath to use CQF.