Closed Bug 1256593 Opened 4 years ago Closed 4 years ago

[Static Analysis][Logically dead code] In function DatabaseMaintenance::CheckIntegrity

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1355136 )

Attachments

(1 file)

The Static Analysis tool Coverity added that the following code is dead:

>>if (foreignKeysWereEnabled) { 	
>>  stmtSQL.AppendLiteral("ON");
>>} else {
>>  stmtSQL.AppendLiteral("OFF");
>>}

This code executes only if |changedForeignKeys | is true, when this code gets executed |foreignKeysWereEnabled| cannot be true because of the previous statements:

>>    if (foreignKeysWereEnabled) {
>>      changedForeignKeys = false;
>>    }
We don't need two bools, don't we ?
Comment on attachment 8730630 [details]
MozReview Request: Bug 1256593 - remvoed dead code. r?sicking

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/40053/diff/1-2/
Comment on attachment 8730630 [details]
MozReview Request: Bug 1256593 - remvoed dead code. r?sicking

Jan, can you take this one?

If this code really can't execute, we should check if that's due to a typo, or if the behavior is actually correct.
Attachment #8730630 - Flags: review?(jonas) → review?(jvarga)
Comment on attachment 8730630 [details]
MozReview Request: Bug 1256593 - remvoed dead code. r?sicking

https://reviewboard.mozilla.org/r/40053/#review37401

I believe this patch is correct. We just need to temporarily enable foreign keys for the foreign keys check and if they are already enabled we don't neet to enable/disable them.
Attachment #8730630 - Flags: review?(jvarga) → review+
https://hg.mozilla.org/mozilla-central/rev/6e8bbbacf474
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Duplicate of this bug: 1168590
You need to log in before you can comment on or make changes to this bug.