mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Test the libaries response to read-only or unreadable database, WAL and wal-index files. If a WAL file cannot be opened in read/write mode, return SQLITE_CANTOPEN to the caller.
FossilOrigin-Name: 45bb84c6283d803fc29077fdc2d06fa50ec06a59
This commit is contained in:
@ -137,6 +137,7 @@ proc do_faultsim_test {name args} {
|
||||
# Procedures to save and restore the current file-system state:
|
||||
#
|
||||
# faultsim_save
|
||||
# faultsim_restore
|
||||
# faultsim_save_and_close
|
||||
# faultsim_restore_and_reopen
|
||||
# faultsim_delete_and_reopen
|
||||
@ -153,13 +154,16 @@ proc faultsim_save_and_close {} {
|
||||
catch { db close }
|
||||
return ""
|
||||
}
|
||||
proc faultsim_restore_and_reopen {{dbfile test.db}} {
|
||||
catch { db close }
|
||||
proc faultsim_restore {} {
|
||||
foreach f [glob -nocomplain test.db*] { file delete -force $f }
|
||||
foreach f2 [glob -nocomplain sv_test.db*] {
|
||||
set f [string range $f2 3 end]
|
||||
file copy -force $f2 $f
|
||||
}
|
||||
}
|
||||
proc faultsim_restore_and_reopen {{dbfile test.db}} {
|
||||
catch { db close }
|
||||
faultsim_restore
|
||||
sqlite3 db $dbfile
|
||||
sqlite3_extended_result_codes db 1
|
||||
sqlite3_db_config_lookaside db 0 0 0
|
||||
|
Reference in New Issue
Block a user