[SERVER-66143] Coverity analysis defect 122176: Redundant test Created: 03/May/22  Updated: 06/Dec/22  Resolved: 11/May/22

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Backlog - Query Execution
Resolution: Duplicate Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2022-05-03 at 10.06.48 AM.png    
Issue Links:
Duplicate
duplicates SERVER-66107 Fix bug in column cell parsing logic Closed
Assigned Teams:
Query Execution
Operating System: ALL
Participants:

 Description   

Redundant test

By the time the program execution reaches the test of this condition there is only one possible outcome for the test. The code at the destination of this branch is not dead, either because this condition is always true or because there is at least one other branch that reaches it. Test always evaluates the same
/src/mongo/db/storage/column_store.h:429: DEADCODE 122176 Condition "208 >= firstByte", taking true branch. Now the value of "firstByte" is at most 208.
/src/mongo/db/storage/column_store.h:429: DEADCODE 122176 Condition "firstByte <= 239", taking true branch. Now the value of "firstByte" is at most 208.
/src/mongo/db/storage/column_store.h:435: DEADCODE 122176 Condition "208 <= firstByte", taking false branch. Now the value of "firstByte" is at most 207.
/src/mongo/db/storage/column_store.h:440: DEADCODE 122176 When switching on "firstByte", the value of "firstByte" must be at most 207.
/src/mongo/db/storage/column_store.h:449: DEADCODE 122176 The "switch" governing value "firstByte" cannot be "239".
/src/mongo/db/storage/column_store.h:449: DEADCODE 122176 Execution cannot reach this statement: "case 239:".



 Comments   
Comment by Githook User [ 11/May/22 ]

Author:

{'name': 'Mathias Stearn', 'email': 'redbeard0531@gmail.com', 'username': 'RedBeard0531'}

Message: SERVER-66103 Teach SplitCellView::parse() to handle new flags

Also fixes SERVER-66107 and SERVER-66143 (same bug).
Branch: master
https://github.com/mongodb/mongo/commit/bf6c449f0379291a922a6235bc73309c0007ed72

Comment by Kyle Suarez [ 03/May/22 ]

Note that a few of the conditions after the initial flagged one also contain potential redundant tests.

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