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

Unified Diff: sql/recovery_unittest.cc

Issue 1414563010: [sql] Disable memory-mapping under sql::Recovery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« sql/connection.cc ('K') | « sql/recovery.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/recovery_unittest.cc
diff --git a/sql/recovery_unittest.cc b/sql/recovery_unittest.cc
index 1f930cbad34dfa3ab0a45ec374fbd248807cd85d..bbddd97221f07870774c34e845a53f12542a9c39 100644
--- a/sql/recovery_unittest.cc
+++ b/sql/recovery_unittest.cc
@@ -692,4 +692,16 @@ TEST_F(SQLRecoveryTest, Bug387868) {
}
#endif // !defined(USE_SYSTEM_SQLITE)
+// Memory-mapped I/O interacts poorly with I/O errors. Make sure the recovery
+// database doesn't accidentally enable it.
+TEST_F(SQLRecoveryTest, NoMmap) {
+ scoped_ptr<sql::Recovery> recovery = sql::Recovery::Begin(&db(), db_path());
+ ASSERT_TRUE(recovery.get());
+
+ // In the current implementation, the PRAGMA successfully runs with no result
+ // rows. Running with a single result of |0| is also acceptable.
+ sql::Statement s(recovery->db()->GetUniqueStatement("PRAGMA mmap_size"));
+ EXPECT_TRUE(!s.Step() || !s.ColumnInt64(0));
+}
+
} // namespace
« sql/connection.cc ('K') | « sql/recovery.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698