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

Unified Diff: sql/recovery.cc

Issue 1778823002: Revert of [sqlite] sql::Recovery working under USE_SYSTEM_SQLITE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@zzzzsql_ios_recover_review1
Patch Set: Created 4 years, 9 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 | « sql/BUILD.gn ('k') | 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 7b9ca9f6fee65724a310e1f34620b97faf60bc7b..b79fe08598ec331a7452f70c9b56fdc23ed009d0 100644
--- a/sql/recovery.cc
+++ b/sql/recovery.cc
@@ -98,7 +98,11 @@
// static
bool Recovery::FullRecoverySupported() {
// TODO(shess): See comment in Init().
+#if defined(USE_SYSTEM_SQLITE)
+ return false;
+#else
return true;
+#endif
}
// static
@@ -199,7 +203,16 @@
return false;
}
- // Enable the recover virtual table for this connection.
+ // TODO(shess): Figure out a story for USE_SYSTEM_SQLITE. The
+ // virtual table implementation relies on SQLite internals for some
+ // types and functions, which could be copied inline to make it
+ // standalone. Or an alternate implementation could try to read
+ // through errors entirely at the SQLite level.
+ //
+ // 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);
@@ -207,6 +220,10 @@
<< 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 | « sql/BUILD.gn ('k') | sql/recovery_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698