Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54299

Mark OrMatchExpression::matchesSingleElement as dead code

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Query Execution 2021-02-22

      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.

            Assignee:
            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            Reporter:
            nikita.lapkov@mongodb.com Nikita Lapkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: