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

Unified Diff: sql/connection.cc

Issue 2225333003: Recreate the WebData database on a catastrophic SQL error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Recover DB and show profile error dialog Created 4 years, 4 months 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
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 9c7cb7d4099a811bc78b314070ab2fd1eebb1eb4..2364acf45ed018861b59e88d5b2bf5aee430a804 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -1733,6 +1733,14 @@ bool Connection::OpenInternal(const std::string& file_name,
// secure_delete.
ignore_result(Execute("PRAGMA journal_mode = TRUNCATE"));
+ bool was_poisoned = poisoned_;
+ if (was_poisoned) {
+ Close();
+ if (retry_flag == RETRY_ON_POISON)
+ return OpenInternal(file_name, NO_RETRY);
+ return false;
+ }
+
Scott Hess - ex-Googler 2016/08/18 21:51:38 I'd prefer the version I posted to you under separ
afakhry 2016/08/19 18:01:57 Agreed. I'll wait until you land yours and rebase
const base::TimeDelta kBusyTimeout =
base::TimeDelta::FromSeconds(kBusyTimeoutSeconds);

Powered by Google App Engine
This is Rietveld 408576698