зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5130029a12c6 (bug 1748509) for causing failures in browser_startup_mainthreadio.js CLOSED TREE
This commit is contained in:
Родитель
643992c765
Коммит
d4f5bdeac0
|
@ -1225,12 +1225,7 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) {
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
if (currentSchemaVersion < 62) {
|
||||
rv = MigrateV62Up();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Firefox 97 uses schema version 62
|
||||
// Firefox 97 uses schema version 61
|
||||
|
||||
// Schema Upgrades must add migration code here.
|
||||
// >>> IMPORTANT! <<<
|
||||
|
@ -1327,8 +1322,6 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) {
|
|||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
CREATE_IDX_MOZ_PLACES_METADATA_PLACECREATED);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_PLACES_METADATA_REFERRER);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// moz_places_metadata_search_queries
|
||||
rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SEARCH_QUERIES);
|
||||
|
@ -1337,17 +1330,11 @@ nsresult Database::InitSchema(bool* aDatabaseMigrated) {
|
|||
// moz_places_metadata_snapshots
|
||||
rv = mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SNAPSHOTS);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// moz_places_metadata_snapshots_extra
|
||||
rv =
|
||||
mMainConn->ExecuteSimpleSQL(CREATE_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// moz_places_metadata_snapshots_groups
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
|
@ -2379,32 +2366,6 @@ nsresult Database::MigrateV61Up() {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult Database::MigrateV62Up() {
|
||||
// Add previews tombstones table if necessary.
|
||||
nsCOMPtr<mozIStorageStatement> stmt;
|
||||
nsresult rv = mMainConn->CreateStatement(
|
||||
"SELECT builder FROM moz_places_metadata_snapshots_groups"_ns,
|
||||
getter_AddRefs(stmt));
|
||||
if (NS_FAILED(rv)) {
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
"ALTER TABLE moz_places "
|
||||
"ADD COLUMN builder TEXT NOT NULL "
|
||||
"ADD COLUMN builder_data TEXT "_ns);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
rv = mMainConn->ExecuteSimpleSQL(CREATE_IDX_MOZ_PLACES_METADATA_REFERRER);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mMainConn->ExecuteSimpleSQL(
|
||||
CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult Database::ConvertOldStyleQuery(nsCString& aURL) {
|
||||
AutoTArray<QueryKeyValuePair, 8> tokens;
|
||||
nsresult rv = TokenizeQueryString(aURL, &tokens);
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
// This is the schema version. Update it at any schema change and add a
|
||||
// corresponding migrateVxx method below.
|
||||
#define DATABASE_SCHEMA_VERSION 62
|
||||
#define DATABASE_SCHEMA_VERSION 61
|
||||
|
||||
// Fired after Places inited.
|
||||
#define TOPIC_PLACES_INIT_COMPLETE "places-init-complete"
|
||||
|
@ -334,7 +334,6 @@ class Database final : public nsIObserver, public nsSupportsWeakReference {
|
|||
nsresult MigrateV59Up();
|
||||
nsresult MigrateV60Up();
|
||||
nsresult MigrateV61Up();
|
||||
nsresult MigrateV62Up();
|
||||
|
||||
void MigrateV52OriginFrecencies();
|
||||
|
||||
|
|
|
@ -108,18 +108,4 @@
|
|||
CREATE_PLACES_IDX("placecreated_uniqueindex", "moz_places_metadata", \
|
||||
"place_id, created_at", "UNIQUE")
|
||||
|
||||
#define CREATE_IDX_MOZ_PLACES_METADATA_REFERRER \
|
||||
CREATE_PLACES_IDX("referrerindex", "moz_places_metadata", \
|
||||
"referrer_place_id", "")
|
||||
|
||||
// moz_places_metadata_snapshots
|
||||
#define CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_PINNNED \
|
||||
CREATE_PLACES_IDX("pinnedindex", "moz_places_metadata_snapshots", \
|
||||
"user_persisted, last_interaction_at", "")
|
||||
|
||||
// moz_places_metadata_snapshots_extra
|
||||
#define CREATE_IDX_MOZ_PLACES_METADATA_SNAPSHOTS_EXTRA_TYPE \
|
||||
CREATE_PLACES_IDX("typeindex", "moz_places_metadata_snapshots_extra", \
|
||||
"type", "")
|
||||
|
||||
#endif // nsPlacesIndexes_h__
|
||||
|
|
|
@ -334,9 +334,7 @@
|
|||
nsLiteralCString( \
|
||||
"CREATE TABLE IF NOT EXISTS moz_places_metadata_snapshots_groups ( " \
|
||||
" id INTEGER PRIMARY KEY, " \
|
||||
" title TEXT NOT NULL, " \
|
||||
" builder TEXT NOT NULL, " \
|
||||
" builder_data TEXT " \
|
||||
" title TEXT NOT NULL " \
|
||||
")")
|
||||
|
||||
#define CREATE_MOZ_PLACES_METADATA_GROUPS_TO_SNAPSHOTS \
|
||||
|
|
|
@ -15,7 +15,7 @@ var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
// Put any other stuff relative to this test folder below.
|
||||
|
||||
const CURRENT_SCHEMA_VERSION = 62;
|
||||
const CURRENT_SCHEMA_VERSION = 61;
|
||||
const FIRST_UPGRADABLE_SCHEMA_VERSION = 43;
|
||||
|
||||
async function assertAnnotationsRemoved(db, expectedAnnos) {
|
||||
|
|
Двоичный файл не отображается.
|
@ -47,29 +47,3 @@ add_task(async function previews_tombstones_in_database() {
|
|||
let db = await PlacesUtils.promiseDBConnection();
|
||||
await db.execute(`SELECT hash FROM moz_previews_tombstones`);
|
||||
});
|
||||
|
||||
add_task(async function builder_fields_in_database() {
|
||||
let db = await PlacesUtils.promiseDBConnection();
|
||||
await db.execute(
|
||||
`SELECT builder, builder_data FROM moz_places_metadata_snapshots_groups`
|
||||
);
|
||||
|
||||
let rows = await db.execute(
|
||||
`SELECT * FROM sqlite_master WHERE type = "index"`
|
||||
);
|
||||
|
||||
let indexes = rows.map(r => r.getResultByName("name"));
|
||||
|
||||
Assert.ok(
|
||||
indexes.includes("moz_places_metadata_referrerindex"),
|
||||
"Should contain the referrer index"
|
||||
);
|
||||
Assert.ok(
|
||||
indexes.includes("moz_places_metadata_snapshots_pinnedindex"),
|
||||
"Should contain the pinned index"
|
||||
);
|
||||
Assert.ok(
|
||||
indexes.includes("moz_places_metadata_snapshots_extra_typeindex"),
|
||||
"Should contain the type index"
|
||||
);
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ support-files =
|
|||
places_outdated.sqlite
|
||||
places_v43.sqlite
|
||||
places_v54.sqlite
|
||||
places_v62.sqlite
|
||||
places_v61.sqlite
|
||||
|
||||
[test_current_from_downgraded.js]
|
||||
[test_current_from_outdated.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче