Bug 1125969 - Fix reversed assertion when reading database metadata, r=janv.
authorBen Turner <bent.mozilla@gmail.com>
Mon, 26 Jan 2015 22:25:47 -0800
changeset 239291 4a027633ff64a5eddee8f59bee20e677b51268b9
parent 239290 9c28c90d340815877e06579f29539f642fcac43f
child 239292 304e3ccaf5331fb8c200dc9ec9fd0ee05811ca3a
push id497
push usermleibovic@mozilla.com
push dateWed, 28 Jan 2015 16:43:37 +0000
reviewersjanv
bugs1125969
milestone38.0a1
Bug 1125969 - Fix reversed assertion when reading database metadata, r=janv.
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -12268,22 +12268,22 @@ OpenDatabaseOp::AssertMetadataConsistenc
   MOZ_ASSERT(thisDB->mCommonMetadata.name() == otherDB->mCommonMetadata.name());
   MOZ_ASSERT(thisDB->mCommonMetadata.version() ==
                otherDB->mCommonMetadata.version());
   MOZ_ASSERT(thisDB->mCommonMetadata.persistenceType() ==
                otherDB->mCommonMetadata.persistenceType());
   MOZ_ASSERT(thisDB->mDatabaseId == otherDB->mDatabaseId);
   MOZ_ASSERT(thisDB->mFilePath == otherDB->mFilePath);
 
-  // The newer database metadata (db2) reflects the latest objectStore and index
-  // ids that have committed to disk. The in-memory metadata (db1) keeps track
-  // of objectStores and indexes that were created and then removed as well, so
-  // the next ids for db1 may be higher than for db2.
-  MOZ_ASSERT(thisDB->mNextObjectStoreId >= otherDB->mNextObjectStoreId);
-  MOZ_ASSERT(thisDB->mNextIndexId >= otherDB->mNextIndexId);
+  // |thisDB| reflects the latest objectStore and index ids that have committed
+  // to disk. The in-memory metadata |otherDB| keeps track of objectStores and
+  // indexes that were created and then removed as well, so the next ids for
+  // |otherDB| may be higher than for |thisDB|.
+  MOZ_ASSERT(thisDB->mNextObjectStoreId <= otherDB->mNextObjectStoreId);
+  MOZ_ASSERT(thisDB->mNextIndexId <= otherDB->mNextIndexId);
 
   MOZ_ASSERT(thisDB->mObjectStores.Count() == otherDB->mObjectStores.Count());
 
   Helper::AssertConsistent(thisDB->mObjectStores, otherDB->mObjectStores);
 }
 
 #endif // DEBUG