[SERVER-76944] Correctly return bool in the prepSubNodes function in plan_enumerator.cpp Created: 09/May/23  Updated: 29/Oct/23  Resolved: 11/May/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 7.0.0-rc2

Type: Bug Priority: Major - P3
Reporter: Adi Agrawal Assignee: Adi Agrawal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v7.0, v6.0, v5.0, v4.4
Participants:
Linked BF Score: 138

 Description   

The plan_enumerator calls prepMemo here which calls prepSubNodes here. If we have a nested AND with a child that requires an index then in prepSubNodes, the parent node calls prepSubNodes here. It correctly recognizes that the subNode is mandatory and returns false, however the call to prepSubNodes is not returned, so it's lost. This can falsely indicate that an indexed plan is possible, when it is not. We should return the value here so it is propagated to prepMemo correctly. 



 Comments   
Comment by Githook User [ 18/May/23 ]

Author:

{'name': 'Adityavardhan Agrawal', 'email': 'adi.agrawal@mongodb.com', 'username': 'Adityav369'}

Message: SERVER-76944: Correctly return bool in the prepSubNodes function in plan_enumerator.cpp

(cherry picked from commit bb7468fd0c2f7f2e3bdd4561d2c906f9ebb007ab)
Branch: v7.0
https://github.com/mongodb/mongo/commit/567dd42407f6a40916a26a808cb90395bc96027d

Comment by Githook User [ 11/May/23 ]

Author:

{'name': 'Adityavardhan Agrawal', 'email': 'adi.agrawal@mongodb.com', 'username': 'Adityav369'}

Message: SERVER-76944: Correctly return bool in the prepSubNodes function in plan_enumerator.cpp
Branch: master
https://github.com/mongodb/mongo/commit/bb7468fd0c2f7f2e3bdd4561d2c906f9ebb007ab

Generated at Thu Feb 08 06:34:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.