Last Comment Bug 703398 - IndexedDB: SQLite files with unknown schema versions should not be deleted
: IndexedDB: SQLite files with unknown schema versions should not be deleted
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: IndexedDB (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Ben Turner (not reading bugmail, use the needinfo flag!)
:
:
Mentors:
Depends on:
Blocks: 702889
  Show dependency treegraph
 
Reported: 2011-11-17 14:30 PST by Ben Turner (not reading bugmail, use the needinfo flag!)
Modified: 2012-03-22 11:52 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
affected
-
fixed
-
fixed


Attachments
Patch, v1 (4.02 KB, patch)
2011-11-17 14:30 PST, Ben Turner (not reading bugmail, use the needinfo flag!)
jonas: review+
Details | Diff | Splinter Review
Patch, v1.1 (4.08 KB, patch)
2011-11-17 16:02 PST, Ben Turner (not reading bugmail, use the needinfo flag!)
bent.mozilla: review+
christian: approval‑mozilla‑aurora+
christian: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description Ben Turner (not reading bugmail, use the needinfo flag!) 2011-11-17 14:30:01 PST
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.
Comment 1 Jonas Sicking (:sicking) No longer reading bugmail consistently 2011-11-17 15:53:17 PST
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.
Comment 2 Ben Turner (not reading bugmail, use the needinfo flag!) 2011-11-17 16:02:32 PST
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.
Comment 3 christian 2011-11-22 10:26:34 PST
Comment on attachment 575324 [details] [diff] [review]
Patch, v1.1

[triage comment]
Approved for aurora and beta. Please land asap.
Comment 5 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-01-06 04:44:40 PST
Did this ever land on mozilla-central?
Comment 6 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-01-06 08:08:36 PST
This was only for branches iirc. We fixed on m-c in one of the other schema upgrades.

Note You need to log in before you can comment on or make changes to this bug.