summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 03:07:13 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 03:07:13 +0000
commit1990c7030d8bb4809f536c8d6363121025a904d5 (patch)
treef58b07dfc26efcbbcb42b01b0f1391c46a48ae2e /chrome/browser/history
parente951026df973ce09f861320df72298f1db2edf54 (diff)
downloadchromium_src-1990c7030d8bb4809f536c8d6363121025a904d5.zip
chromium_src-1990c7030d8bb4809f536c8d6363121025a904d5.tar.gz
chromium_src-1990c7030d8bb4809f536c8d6363121025a904d5.tar.bz2
Fix non-unique copy into history in-memory urls table.
The in-memory urls table is populated first from typed URLs, then from URLs selected by keyword searches. If an URL was matched by multiple keywoard searches, the latter could result in multiple rows conflicting and a failure to insert those URLs. Since urls.id is unique, use INSERT OR IGNORE to ignore the duplicates. BUG=223435 Review URL: https://chromiumcodereview.appspot.com/13350011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191750 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history')
-rw-r--r--chrome/browser/history/in_memory_database.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/browser/history/in_memory_database.cc b/chrome/browser/history/in_memory_database.cc
index 02b335f..2f41481 100644
--- a/chrome/browser/history/in_memory_database.cc
+++ b/chrome/browser/history/in_memory_database.cc
@@ -103,7 +103,7 @@ bool InMemoryDatabase::InitFromDisk(const base::FilePath& history_name) {
// Insert keyword search related URLs.
begin_load = base::TimeTicks::Now();
if (!db_.Execute(
- "INSERT INTO urls SELECT u.id, u.url, u.title, u.visit_count, "
+ "INSERT OR IGNORE INTO urls SELECT u.id, u.url, u.title, u.visit_count, "
"u.typed_count, u.last_visit_time, u.hidden, u.favicon_id "
"FROM history.urls u JOIN history.keyword_search_terms kst "
"WHERE u.typed_count = 0 AND u.id = kst.url_id")) {