summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/icecat-bug-1415133.patch
blob: 4e322d21fb835c7d163b6cec1f7d37a81caa5202 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Based on:
  https://hg.mozilla.org/releases/mozilla-esr52/raw-rev/22fe3ff3f923

Adapted to apply cleanly to IceCat.

# HG changeset patch
# User Marco Bonardo <mbonardo@mozilla.com>
# Date 1510052455 -3600
# Node ID 22fe3ff3f92358596521f7155ddc512006022207
# Parent  2909ba991f3134f9fbf4859cf08582f1c9845594
Bug 1415133 - Downgrades from 55+ to ESR lose bookmarks. r=past a=lizzard

MozReview-Commit-ID: 44Rw7m1FP4h

diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -761,16 +761,21 @@ Database::InitSchema(bool* aDatabaseMigr
     // 2. implement a method that performs upgrade to your version from the
     //    previous one.
     //
     // NOTE: The downgrade process is pretty much complicated by the fact old
     //       versions cannot know what a new version is going to implement.
     //       The only thing we will do for downgrades is setting back the schema
     //       version, so that next upgrades will run again the migration step.
 
+    if (currentSchemaVersion > 36) {
+      // These versions are not downgradable.
+      return NS_ERROR_FILE_CORRUPTED;
+    }
+
     if (currentSchemaVersion < DATABASE_SCHEMA_VERSION) {
       *aDatabaseMigrated = true;
 
       if (currentSchemaVersion < 11) {
         // These are versions older than IceCat 4 that are not supported
         // anymore.  In this case it's safer to just replace the database.
         return NS_ERROR_FILE_CORRUPTED;
       }