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

Some failed count operations can return the wrong error code

    • Fully Compatible
    • ALL

      This line of code is supposed to set the error code on a count operation when we fail to construct a plan executor for the count. However, it sets the error code using the Status from parsing the command request instead of the Status from retrieving a PlanExecutor. This could cause failed count operations to report the wrong error code.

      This issue only affects count commands which run through the DBDirectClient.

      Original Description

      A new defect has been detected and assigned to david.storch in Coverity Connect.
      http://coverity.mongodb.com//sourcebrowser.htm?projectId=10001#mergedDefectId=32048
      The defect was flagged by checker COPY_PASTE_ERROR in
      file /src/mongo/db/commands/count.cpp
      function mongo::runCount(mongo::OperationContext *, const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, const mongo::BSONObj &, std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int &)
      and this ticket was created by asya

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: