Fix the sqlite3_db_readonly() API so that it reports true if the database

is readonly because the file format write version (byte 18 of the header)
is too large.

FossilOrigin-Name: 8d8af114dac301335ec10671c1e9a5a6d8266a60
This commit is contained in:
drh
2014-05-21 08:21:07 +00:00
parent 27f2468422
commit 781597feca
6 changed files with 26 additions and 12 deletions
+6
View File
@@ -32,6 +32,9 @@ do_test rdonly-1.1 {
SELECT * FROM t1;
}
} {1}
do_test rdonly-1.1.1 {
sqlite3_db_readonly db main
} {0}
# Changes the write version from 1 to 3. Verify that the database
# can be read but not written.
@@ -47,6 +50,9 @@ do_test rdonly-1.3 {
SELECT * FROM t1;
}
} {1}
do_test rdonly-1.3.1 {
sqlite3_db_readonly db main
} {1}
do_test rdonly-1.4 {
catchsql {
INSERT INTO t1 VALUES(2)