From 1a1d8e397a3c537277df9d29f8b44161bc87f123 Mon Sep 17 00:00:00 2001 From: "brettw%gmail.com" Date: Wed, 15 Feb 2006 18:15:31 +0000 Subject: [PATCH] Bug 327318, r=annie.sullivan. History service fails if indices already exist. --- browser/components/places/src/nsNavHistory.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/browser/components/places/src/nsNavHistory.cpp b/browser/components/places/src/nsNavHistory.cpp index d291bab76aec..3a644c95da33 100644 --- a/browser/components/places/src/nsNavHistory.cpp +++ b/browser/components/places/src/nsNavHistory.cpp @@ -3440,6 +3440,10 @@ nsNavHistory::SetPageTitleInternal(nsIURI* aURI, PRBool aIsUserTitle, // This creates some indexes on the history tables which are expensive to // update when we're doing many insertions, as with history import. Instead, // we defer creation of the index until import is finished. +// +// FIXME: We should check if the index exists (bug 327317) and then not +// try to create it. That way we can check for errors. Currently we ignore +// errors since the indeices may already exist. nsresult nsNavHistory::CreateLookupIndexes() @@ -3449,18 +3453,18 @@ nsNavHistory::CreateLookupIndexes() // History table indexes rv = mDBConn->ExecuteSimpleSQL( NS_LITERAL_CSTRING("CREATE INDEX moz_history_hostindex ON moz_history (rev_host)")); - NS_ENSURE_SUCCESS(rv, rv); + //NS_ENSURE_SUCCESS(rv, rv); rv = mDBConn->ExecuteSimpleSQL( NS_LITERAL_CSTRING("CREATE INDEX moz_history_visitcount ON moz_history (visit_count)")); - NS_ENSURE_SUCCESS(rv, rv); + //NS_ENSURE_SUCCESS(rv, rv); // Visit table indexes rv = mDBConn->ExecuteSimpleSQL( NS_LITERAL_CSTRING("CREATE INDEX moz_historyvisit_fromindex ON moz_historyvisit (from_visit)")); - NS_ENSURE_SUCCESS(rv, rv); + //NS_ENSURE_SUCCESS(rv, rv); rv = mDBConn->ExecuteSimpleSQL( NS_LITERAL_CSTRING("CREATE INDEX moz_historyvisit_dateindex ON moz_historyvisit (visit_date)")); - NS_ENSURE_SUCCESS(rv, rv); + //NS_ENSURE_SUCCESS(rv, rv); #ifdef IN_MEMORY_LINKS // In-memory links indexes