| 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.
|
|
|