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 |