Index: sql/connection.cc |
diff --git a/sql/connection.cc b/sql/connection.cc |
index 6e02cd755f56a31342f6291b4ae418303d5781c9..c46cb4c55f4bf789d5298b5e3086064daa67e4d2 100644 |
--- a/sql/connection.cc |
+++ b/sql/connection.cc |
@@ -1050,9 +1050,18 @@ int Connection::OnSqliteError(int err, sql::Statement *stmt, const char* sql) { |
return err; |
} |
-// TODO(shess): Allow specifying integrity_check versus quick_check. |
+bool Connection::FullIntegrityCheck(std::vector<std::string>* messages) { |
+ return IntegrityCheckHelper("PRAGMA integrity_check", messages); |
+} |
+ |
+bool Connection::QuickIntegrityCheck(std::vector<std::string>* messages) { |
+ return IntegrityCheckHelper("PRAGMA quick_check", messages); |
+} |
+ |
// TODO(shess): Allow specifying maximum results (default 100 lines). |
-bool Connection::IntegrityCheck(std::vector<std::string>* messages) { |
+bool Connection::IntegrityCheckHelper( |
+ const char* pragma_sql, |
+ std::vector<std::string>* messages) { |
messages->clear(); |
// This has the side effect of setting SQLITE_RecoveryMode, which |
@@ -1065,8 +1074,7 @@ bool Connection::IntegrityCheck(std::vector<std::string>* messages) { |
bool ret = false; |
{ |
- const char kSql[] = "PRAGMA integrity_check"; |
- sql::Statement stmt(GetUniqueStatement(kSql)); |
+ sql::Statement stmt(GetUniqueStatement(pragma_sql)); |
// The pragma appears to return all results (up to 100 by default) |
// as a single string. This doesn't appear to be an API contract, |