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

Unified Diff: sql/recovery.cc

Issue 1700483002: [sqlite] iOS running recover virtual table. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@zzsql_recover_handle_review2
Patch Set: Manually find sql/test/data for now. Created 4 years, 10 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
« no previous file with comments | « no previous file | sql/recovery_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/recovery.cc
diff --git a/sql/recovery.cc b/sql/recovery.cc
index 09e0c37b8fb643c379d46b670e5277bfeef1c8e7..0cbc1ca97f4dbea40abed0ca8895446abe8f1a26 100644
--- a/sql/recovery.cc
+++ b/sql/recovery.cc
@@ -15,6 +15,7 @@
#include "base/strings/stringprintf.h"
#include "sql/connection.h"
#include "sql/statement.h"
+#include "third_party/sqlite/ext/recover.h"
#include "third_party/sqlite/sqlite3.h"
namespace sql {
@@ -97,26 +98,15 @@ void RecordRecoveryEvent(RecoveryEventType recovery_event) {
// static
bool Recovery::FullRecoverySupported() {
// TODO(shess): See comment in Init().
-#if defined(USE_SYSTEM_SQLITE)
- return false;
-#else
return true;
-#endif
}
// static
scoped_ptr<Recovery> Recovery::Begin(
Connection* connection,
const base::FilePath& db_path) {
- // Recovery is likely to be used in error handling. Since recovery changes
- // the state of the handle, protect against multiple layers attempting the
- // same recovery.
- if (!connection->is_open()) {
- // Warn about API mis-use.
- DLOG_IF(FATAL, !connection->poisoned_)
- << "Illegal to recover with closed database";
+ if (!connection->is_open())
return scoped_ptr<Recovery>();
- }
scoped_ptr<Recovery> r(new Recovery(connection));
if (!r->Init(db_path)) {
@@ -211,7 +201,6 @@ bool Recovery::Init(const base::FilePath& db_path) {
// For now, defer to the caller. The setup will succeed, but the
// later CREATE VIRTUAL TABLE call will fail, at which point the
// caller can fire Unrecoverable().
-#if !defined(USE_SYSTEM_SQLITE)
int rc = recoverVtableInit(recover_db_.db_);
if (rc != SQLITE_OK) {
RecordRecoveryEvent(RECOVERY_FAILED_VIRTUAL_TABLE_INIT);
@@ -219,10 +208,6 @@ bool Recovery::Init(const base::FilePath& db_path) {
<< recover_db_.GetErrorMessage();
return false;
}
-#else
- // If this is infrequent enough, just wire it to Raze().
- RecordRecoveryEvent(RECOVERY_FAILED_VIRTUAL_TABLE_SYSTEM_SQLITE);
-#endif
// Turn on |SQLITE_RecoveryMode| for the handle, which allows
// reading certain broken databases.
« no previous file with comments | « no previous file | sql/recovery_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698