Bug 1127763 - Some database might be missing the favicons guid index. r=mak

This commit is contained in:
Timur Valeev 2015-05-27 15:52:34 +03:00
Родитель addc4dacac
Коммит e14fb47c21
5 изменённых файлов: 25 добавлений и 4 удалений

Просмотреть файл

@ -751,6 +751,13 @@ Database::InitSchema(bool* aDatabaseMigrated)
// Firefox 39 uses schema version 28. // Firefox 39 uses schema version 28.
if (currentSchemaVersion < 29) {
rv = MigrateV29Up();
NS_ENSURE_SUCCESS(rv, rv);
}
// Firefox 41 uses schema version 29.
// Schema Upgrades must add migration code here. // Schema Upgrades must add migration code here.
rv = UpdateBookmarkRootTitles(); rv = UpdateBookmarkRootTitles();
@ -823,6 +830,8 @@ Database::InitSchema(bool* aDatabaseMigrated)
// moz_favicons. // moz_favicons.
rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_FAVICONS); rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_FAVICONS);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_FAVICONS_GUID);
NS_ENSURE_SUCCESS(rv, rv);
// moz_anno_attributes. // moz_anno_attributes.
rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_ANNO_ATTRIBUTES); rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_ANNO_ATTRIBUTES);
@ -1604,6 +1613,16 @@ Database::MigrateV28Up() {
return NS_OK; return NS_OK;
} }
nsresult
Database::MigrateV29Up() {
MOZ_ASSERT(NS_IsMainThread());
nsresult rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_FAVICONS_GUID);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
void void
Database::Shutdown() Database::Shutdown()
{ {
@ -1638,7 +1657,7 @@ Database::Observe(nsISupports *aSubject,
const char16_t *aData) const char16_t *aData)
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
if (strcmp(aTopic, TOPIC_PROFILE_CHANGE_TEARDOWN) == 0) { if (strcmp(aTopic, TOPIC_PROFILE_CHANGE_TEARDOWN) == 0) {
// Tests simulating shutdown may cause multiple notifications. // Tests simulating shutdown may cause multiple notifications.
if (mShuttingDown) { if (mShuttingDown) {

Просмотреть файл

@ -16,7 +16,7 @@
// This is the schema version. Update it at any schema change and add a // This is the schema version. Update it at any schema change and add a
// corresponding migrateVxx method below. // corresponding migrateVxx method below.
#define DATABASE_SCHEMA_VERSION 28 #define DATABASE_SCHEMA_VERSION 29
// Fired after Places inited. // Fired after Places inited.
#define TOPIC_PLACES_INIT_COMPLETE "places-init-complete" #define TOPIC_PLACES_INIT_COMPLETE "places-init-complete"
@ -253,7 +253,7 @@ protected:
/** /**
* Initializes triggers defined in nsPlacesTriggers.h * Initializes triggers defined in nsPlacesTriggers.h
*/ */
nsresult InitTempTriggers(); nsresult InitTempTriggers();
/** /**
@ -275,6 +275,7 @@ protected:
nsresult MigrateV26Up(); nsresult MigrateV26Up();
nsresult MigrateV27Up(); nsresult MigrateV27Up();
nsresult MigrateV28Up(); nsresult MigrateV28Up();
nsresult MigrateV29Up();
nsresult UpdateBookmarkRootTitles(); nsresult UpdateBookmarkRootTitles();

Просмотреть файл

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const CURRENT_SCHEMA_VERSION = 28; const CURRENT_SCHEMA_VERSION = 29;
const FIRST_UPGRADABLE_SCHEMA_VERSION = 11; const FIRST_UPGRADABLE_SCHEMA_VERSION = 11;
const NS_APP_USER_PROFILE_50_DIR = "ProfD"; const NS_APP_USER_PROFILE_50_DIR = "ProfD";

Двоичные данные
toolkit/components/places/tests/migration/places_v29.sqlite Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -17,6 +17,7 @@ support-files =
places_v26.sqlite places_v26.sqlite
places_v27.sqlite places_v27.sqlite
places_v28.sqlite places_v28.sqlite
places_v29.sqlite
[test_current_from_downgraded.js] [test_current_from_downgraded.js]
[test_current_from_v6.js] [test_current_from_v6.js]