[SERVER-15718] Some failed count operations can return the wrong error code Created: 18/Oct/14  Updated: 25/Oct/14  Resolved: 20/Oct/14

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: David Storch
Resolution: Done Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 20/Oct/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-15718 fix error code for count
Branch: master
https://github.com/mongodb/mongo/commit/a5cc0c52ce3b52f5b9a23009a74fa848b4b308e1

Generated at Thu Feb 08 03:38:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.