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

RESOLVED FIXED

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Ben Turner (not reading bugmail, use the needinfo flag!), Assigned: Ben Turner (not reading bugmail, use the needinfo flag!))

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(firefox8 affected, firefox9- fixed, firefox10- fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 575299 [details] [diff] [review]
Patch, v1

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)
status-firefox10: --- → affected
status-firefox8: --- → affected
status-firefox9: --- → affected
tracking-firefox10: --- → ?
tracking-firefox9: --- → ?
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+
Created attachment 575324 [details] [diff] [review]
Patch, v1.1

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 3

6 years ago
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+
https://hg.mozilla.org/releases/mozilla-aurora/rev/9c12817a0678
https://hg.mozilla.org/releases/mozilla-beta/rev/a4086b2b8132
status-firefox10: affected → fixed
status-firefox9: affected → fixed

Updated

6 years ago
tracking-firefox10: ? → -
tracking-firefox9: ? → -
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.
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Component: DOM → DOM: IndexedDB
You need to log in before you can comment on or make changes to this bug.