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

Coverity analysis defect 128615: 'Constant' variable guards dead code

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • QO 2022-08-22

      'Constant' variable guards dead code

      A variable being assigned only once may be intentionally guarding disabled code, or it may represent incomplete logic where a missing assignment would make the variable not be constant. Variable assigned once to a constant guards dead code.
      /src/mongo/db/query/optimizer/utils/utils.cpp:1049: DEADCODE 128615 Assigning: "indexSuitable" = "true".
      /src/mongo/db/query/optimizer/utils/utils.cpp:1153: DEADCODE 128615 At condition "indexSuitable", the value of "indexSuitable" must be equal to 1.
      /src/mongo/db/query/optimizer/utils/utils.cpp:1153: DEADCODE 128615 The condition "!indexSuitable" cannot be true.
      /src/mongo/db/query/optimizer/utils/utils.cpp:1154: DEADCODE 128615 Execution cannot reach this statement: "continue;".

            Assignee:
            svilen.mihaylov@mongodb.com Svilen Mihaylov (Inactive)
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: