[SERVER-68665] Coverity analysis defect 128615: 'Constant' variable guards dead code Created: 09/Aug/22  Updated: 29/Oct/23  Resolved: 10/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2022-08-22
Participants:

 Description   

'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;".



 Comments   
Comment by Githook User [ 09/Aug/22 ]

Author:

{'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com', 'username': 'smihaylov-mongodb'}

Message: SERVER-68665 Coverity analysis defect 128615: 'Constant' variable guards dead code
Branch: master
https://github.com/mongodb/mongo/commit/ac8fa6818ba2387f3b887a794e48b7a6effbb7da

Generated at Thu Feb 08 06:11:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.