[SERVER-54299] Mark OrMatchExpression::matchesSingleElement as dead code Created: 04/Feb/21  Updated: 29/Oct/23  Resolved: 11/Feb/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Nikita Lapkov (Inactive) Assignee: Nikita Lapkov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-14214 Investigate changes in SERVER-54299: ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-02-22
Participants:

 Description   

During the discussion of SERVER-52914, we have noticed that OrMatchExpression::matchesSingleElement has a different handling of MatchDetails object compared to OrMatchExpression::matches. During the investigation we have started to wonder if this method ever gets called. It looks like query parser simply does not allow a query where this method would be called.

Our coverage report for July 2019 says that this method is not covered by tests. Recent Evergreen patch where this method was replaced with MONGO_UNREACHABLE passes without any failures.

It is highly unlikely that our tests do not cover some case where OrMatchExpression::matchesSingleElement is used, so we concluded that this is a dead code. We should replace the body of this method with MONGO_UNREACHABLE_TASSERT to avoid further confusion.



 Comments   
Comment by Githook User [ 10/Feb/21 ]

Author:

{'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com', 'username': 'laplab'}

Message: SERVER-54299 Mark OrMatchExpression::matchesSingleElement as dead code
Branch: master
https://github.com/mongodb/mongo/commit/172d3ae1e4dc2c95b2f22b0271088bbb8cbc60b3

Generated at Thu Feb 08 05:33:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.