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

Invariant in PlanStage::dispose always evaluates as true

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.4.1, 3.6.20, 4.7.0, 4.0.21
    • Querying
    • None
    • Fully Compatible
    • ALL
    • v4.4, v4.2, v4.0, v3.6
    • Dev Platform 2020-08-24

    Description

      Due to a typo in the PlanStage::dispose() invariant it can never be evaluated to false.

      src/mongo/db/exec/plan_stage.h:271:62: warning: self-comparison always evaluates to true [-Wtautological-compare]
       
                  ::mongo::invariantWithLocation((!_opCtx !_opCtx || opCtx == opCtx", "src/mongo/db/exec/plan_stage.h", 271);
      

      The opCtx == opCtx condition should be opCtx == _optCtx.

      Note that there is a task SERVER-37453 to delete PlantExecutor::dispose() method and its friends, so we may not need to fix this issue if the dispose() code is being removed in next sprint.

      Attachments

        Issue Links

          Activity

            People

              andrew.morrow@mongodb.com Andrew Morrow
              anton.korshunov@mongodb.com Anton Korshunov
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: