Add the sqlite3_db_readonly() interface. This is still tentative, pending

a closer look at other ideas to accomplish the same thing.

FossilOrigin-Name: 254f99ea9ff1534948bdb179e69ab0c940c87ec1
This commit is contained in:
drh
2012-03-15 21:28:54 +00:00
parent 331b67c151
commit 421377e67a
7 changed files with 110 additions and 43 deletions
+18
View File
@@ -887,6 +887,24 @@ do_test pager1.4.7.3 {
delete_file test.db-journal
file exists test.db-journal
} {0}
do_test pager1.4.8.1 {
catch {file attributes test.db -permissions r--------}
catch {file attributes test.db -readonly 1}
sqlite3 db test.db
db eval { SELECT * FROM t1 }
sqlite3_db_readonly db main
} {1}
do_test pager1.4.8.2 {
sqlite3_db_readonly db xyz
} {-1}
do_test pager1.4.8.3 {
db close
catch {file attributes test.db -permissions rw-rw-rw-}
catch {file attributes test.db -readonly 0}
sqlite3 db test.db
db eval { SELECT * FROM t1 }
sqlite3_db_readonly db main
} {0}
#-------------------------------------------------------------------------
# The following tests deal with multi-file commits.