summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/connection.cc10
-rw-r--r--sql/connection_unittest.cc2
2 files changed, 5 insertions, 7 deletions
diff --git a/sql/connection.cc b/sql/connection.cc
index b91234b..8720985 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -988,12 +988,10 @@ bool Connection::OpenInternal(const std::string& file_name,
// DELETE (default) - delete -journal file to commit.
// TRUNCATE - truncate -journal file to commit.
// PERSIST - zero out header of -journal file to commit.
- // journal_size_limit provides size to trim to in PERSIST.
- // TODO(shess): Figure out if PERSIST and journal_size_limit really
- // matter. In theory, it keeps pages pre-allocated, so if
- // transactions usually fit, it should be faster.
- ignore_result(Execute("PRAGMA journal_mode = PERSIST"));
- ignore_result(Execute("PRAGMA journal_size_limit = 16384"));
+ // TRUNCATE should be faster than DELETE because it won't need directory
+ // changes for each transaction. PERSIST may break the spirit of using
+ // secure_delete.
+ ignore_result(Execute("PRAGMA journal_mode = TRUNCATE"));
const base::TimeDelta kBusyTimeout =
base::TimeDelta::FromSeconds(kBusyTimeoutSeconds);
diff --git a/sql/connection_unittest.cc b/sql/connection_unittest.cc
index e3b9773..ed86eb0 100644
--- a/sql/connection_unittest.cc
+++ b/sql/connection_unittest.cc
@@ -692,7 +692,7 @@ TEST_F(SQLConnectionTest, Delete) {
db().Close();
// Should have both a main database file and a journal file because
- // of journal_mode PERSIST.
+ // of journal_mode TRUNCATE.
base::FilePath journal(db_path().value() + FILE_PATH_LITERAL("-journal"));
ASSERT_TRUE(base::PathExists(db_path()));
ASSERT_TRUE(base::PathExists(journal));