sql: Remove redundant PRAGMA secure_delete=ON.
Chrome builds SQLite with SQLITE_SECURE_DELETE [1], so the default value
for the secure_delete PRAGMA [2] is already true.
[1] https://www.sqlite.org/compile.html#secure_delete
[2] https://www.sqlite.org/pragma.html#pragma_secure_delete
Bug: 910955
Change-Id: I27ef32770a980c8c6030675e79698d7a31e47a9d
Reviewed-on: https://chromium-review.googlesource.com/c/1357824
Commit-Queue: Victor Costan <[email protected]>
Reviewed-by: Chris Mumford <[email protected]>
Cr-Commit-Position: refs/heads/master@{#613866}
diff --git a/sql/database.cc b/sql/database.cc
index 623bd8b..bb6b456 100644
--- a/sql/database.cc
+++ b/sql/database.cc
@@ -1663,8 +1663,8 @@
OnSqliteError(err, nullptr, "PRAGMA auto_vacuum");
// Retry or bail out if the error handler poisoned the handle.
- // TODO(shess): Move this handling to one place (see also sqlite3_open and
- // secure_delete). Possibly a wrapper function?
+ // TODO(shess): Move this handling to one place (see also sqlite3_open).
+ // Possibly a wrapper function?
if (poisoned_) {
Close();
if (retry_flag == RETRY_ON_POISON)
@@ -1715,13 +1715,8 @@
ignore_result(ExecuteWithTimeout(cache_size_sql.c_str(), kBusyTimeout));
}
- if (!ExecuteWithTimeout("PRAGMA secure_delete=ON", kBusyTimeout)) {
- bool was_poisoned = poisoned_;
- Close();
- if (was_poisoned && retry_flag == RETRY_ON_POISON)
- return OpenInternal(file_name, NO_RETRY);
- return false;
- }
+ static_assert(SQLITE_SECURE_DELETE == 1,
+ "Chrome assumes secure_delete is on by default.");
// Set a reasonable chunk size for larger files. This reduces churn from
// remapping memory on size changes. It also reduces filesystem