-
Type: Improvement
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Query Execution 2021-07-26, QE 2021-08-09, QE 2021-08-23, QE 2021-09-06, QE 2021-09-20, QE 2021-10-04, QE 2021-10-18
The sbe_cmd.js test is our one test for checking that the test-only SBE command does something reasonable. This line in the test is verifying that the command runs correctly, but not that it returns the correct results. Also, this line is written incorrectly, since assert(db._sbe(slotBasedPlan)); is checking that the resulting DBCommandCursor is not undefined, which should always be true. Instead, we should call .itcount() or .toArray() on the cursor and check that the returned results are correct.
I tried making this change, and discovered that the returned results are in fact not correct! It appears that the SBE plan returned by explain does not correctly roundtrip and result in the exact same execution plan. It is unclear how much effort we want to spend on the SBE test command in general, but we could consider looking into why exactly the SBE string returned by explain does not return the correct results when run via the SBE command.