Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: chrome/browser/history/url_database.cc

Issue 9005036: [sql] WARN_UNUSED_RESULT on Execute(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error in quota_database_unittest.cc. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/url_database.h ('k') | chrome/browser/history/visit_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/url_database.cc
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc
index 834ece4312130cad262ab6bb2faf14a1956bf916..4a020b97bc924dd7d1b812797dc559c040aa9025 100644
--- a/chrome/browser/history/url_database.cc
+++ b/chrome/browser/history/url_database.cc
@@ -406,14 +406,21 @@ bool URLDatabase::InitKeywordSearchTermsTable() {
return true;
}
-void URLDatabase::CreateKeywordSearchTermsIndices() {
+bool URLDatabase::CreateKeywordSearchTermsIndices() {
// For searching.
- GetDB().Execute("CREATE INDEX keyword_search_terms_index1 ON "
- "keyword_search_terms (keyword_id, lower_term)");
+ if (!GetDB().Execute(
+ "CREATE INDEX IF NOT EXISTS keyword_search_terms_index1 ON "
+ "keyword_search_terms (keyword_id, lower_term)")) {
+ return false;
+ }
// For deletion.
- GetDB().Execute("CREATE INDEX keyword_search_terms_index2 ON "
- "keyword_search_terms (url_id)");
+ if (!GetDB().Execute(
+ "CREATE INDEX IF NOT EXISTS keyword_search_terms_index2 ON "
+ "keyword_search_terms (url_id)")) {
+ return false;
+ }
+ return true;
}
bool URLDatabase::DropKeywordSearchTermsTable() {
@@ -569,10 +576,10 @@ bool URLDatabase::CreateURLTable(bool is_temporary) {
return GetDB().Execute(sql.c_str());
}
-void URLDatabase::CreateMainURLIndex() {
- // Index over URLs so we can quickly look up based on URL. Ignore errors as
- // this likely already exists (and the same below).
- GetDB().Execute("CREATE INDEX urls_url_index ON urls (url)");
+bool URLDatabase::CreateMainURLIndex() {
+ // Index over URLs so we can quickly look up based on URL.
+ return GetDB().Execute(
+ "CREATE INDEX IF NOT EXISTS urls_url_index ON urls (url)");
}
} // namespace history
« no previous file with comments | « chrome/browser/history/url_database.h ('k') | chrome/browser/history/visit_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698