Closed Bug 703398 Opened 10 years ago Closed 10 years ago

IndexedDB: SQLite files with unknown schema versions should not be deleted


(Core :: Storage: IndexedDB, defect)

Not set



Tracking Status
firefox8 --- affected
firefox9 - fixed
firefox10 - fixed


(Reporter: bent.mozilla, Assigned: bent.mozilla)




(1 file, 1 obsolete file)

Attached patch Patch, v1 (obsolete) — Splinter Review
Our indexedDB code right now deletes sqlite databases if the schema version is higher than the in-tree schema. That's bad for testers since their data will be lost if they downgrade Firefox. Attached patch is for branches only since we need these before bug 702889 lands and upgrades the schema.
Attachment #575299 - Flags: review?(jonas)
Assignee: nobody → bent.mozilla
Comment on attachment 575299 [details] [diff] [review]
Patch, v1

Review of attachment 575299 [details] [diff] [review]:

r=me with that fixed.

::: dom/indexedDB/OpenDatabaseHelper.cpp
@@ +448,2 @@
> +    if (schemaVersion != DB_SCHEMA_VERSION) {

If schemaVersion was 4 and we ran the upgrade code above, it'll still be 4 when you get here, right? Seems like you need to set it to 5 after calling UpgradeSchemaFrom4To5 above.
Attachment #575299 - Flags: review?(jonas) → review+
Attached patch Patch, v1.1Splinter Review
Fixed Jonas' review issue.

We'd really like to get this on aurora and beta since we want to make sure that downgrades of Firefox do not destroy indexedDB databases created with newer versions of Firefox. Firefox 11 will bump the schema, so we need 9 and 10 to handle this.
Attachment #575299 - Attachment is obsolete: true
Attachment #575324 - Flags: review+
Attachment #575324 - Flags: approval-mozilla-beta?
Attachment #575324 - Flags: approval-mozilla-aurora?
Comment on attachment 575324 [details] [diff] [review]
Patch, v1.1

[triage comment]
Approved for aurora and beta. Please land asap.
Attachment #575324 - Flags: approval-mozilla-beta?
Attachment #575324 - Flags: approval-mozilla-beta+
Attachment #575324 - Flags: approval-mozilla-aurora?
Attachment #575324 - Flags: approval-mozilla-aurora+
Did this ever land on mozilla-central?
This was only for branches iirc. We fixed on m-c in one of the other schema upgrades.
Closed: 10 years ago
Resolution: --- → FIXED
Component: DOM → DOM: IndexedDB
You need to log in before you can comment on or make changes to this bug.