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

Unified Diff: chrome/browser/history/visitsegment_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/visit_database.cc ('k') | chrome/browser/net/sqlite_persistent_cookie_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/visitsegment_database.cc
diff --git a/chrome/browser/history/visitsegment_database.cc b/chrome/browser/history/visitsegment_database.cc
index ac2afe89ec9968666cdbea812b1f146c8a252856..c8bbfd35811479e7359bc94b0c55eb6f2781af77 100644
--- a/chrome/browser/history/visitsegment_database.cc
+++ b/chrome/browser/history/visitsegment_database.cc
@@ -60,7 +60,9 @@ bool VisitSegmentDatabase::InitSegmentTables() {
// This was added later, so we need to try to create it even if the table
// already exists.
- GetDB().Execute("CREATE INDEX segments_url_id ON segments(url_id)");
+ if (!GetDB().Execute("CREATE INDEX IF NOT EXISTS segments_url_id ON "
+ "segments(url_id)"))
+ return false;
// Segment usage table.
if (!GetDB().DoesTableExist("segment_usage")) {
@@ -81,8 +83,9 @@ bool VisitSegmentDatabase::InitSegmentTables() {
}
// Added in a later version, so we always need to try to creat this index.
- GetDB().Execute("CREATE INDEX segments_usage_seg_id "
- "ON segment_usage(segment_id)");
+ if (!GetDB().Execute("CREATE INDEX IF NOT EXISTS segments_usage_seg_id "
+ "ON segment_usage(segment_id)"))
+ return false;
// Presentation index table.
//
« no previous file with comments | « chrome/browser/history/visit_database.cc ('k') | chrome/browser/net/sqlite_persistent_cookie_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698