Do not invoke the xDelete method when converting to PRAGMA journal_mode=OFF

if the underlying VFS does not support that method.
dbsqlfuzz 39d6af88ef5242f866c4f9b21ede330c5c1e36a8.

FossilOrigin-Name: d91450847a3a3a7217f8f5947adea9a4d12cf77607d40f9724d6ba093919b524
This commit is contained in:
drh 2021-04-05 13:41:42 +00:00
parent 2389048f29
commit d5e7fff2ca
4 changed files with 19 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C As\sa\scontinuation\sof\s[1f66a85b7757754f],\sensure\sthat\san\sOOM\sthat\soccurs\nwhile\schecking\sthe\svalidity\sof\sthe\sschema\sis\sreported\sout\sas\sSQLITE_NOMEM\nand\snot\sas\sSQLITE_SCHEMA.
D 2021-04-05T11:39:55.507
C Do\snot\sinvoke\sthe\sxDelete\smethod\swhen\sconverting\sto\sPRAGMA\sjournal_mode=OFF\nif\sthe\sunderlying\sVFS\sdoes\snot\ssupport\sthat\smethod.\ndbsqlfuzz\s39d6af88ef5242f866c4f9b21ede330c5c1e36a8.
D 2021-04-05T13:41:42.119
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -529,7 +529,7 @@ F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
F src/os_unix.c b5b7475bd1a8f1b83b6173a81f4fe50f9e077ccbacb62ce2fe7a5cb89916bce1
F src/os_win.c 77d39873836f1831a9b0b91894fec45ab0e9ca8e067dc8c549e1d1eca1566fe9
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c 970691daea03f9f15e34de671bd8675c1e136232b529e21bfd36d4dba6d41753
F src/pager.c 989d552db1a9d2b1783c6f0421ce927a46453bf15ae5e5b7174132e3f333b758
F src/pager.h 4bf9b3213a4b2bebbced5eaa8b219cf25d4a82f385d093cd64b7e93e5285f66f
F src/parse.y 2107aff88e361bbf8388fdede3fed20fda875f23ba7585ec83b20e3e16a95670
F src/pcache.c 385ff064bca69789d199a98e2169445dc16e4291fa807babd61d4890c3b34177
@ -1189,7 +1189,7 @@ F test/malloctraceviewer.tcl b7a54595270c1d201abf1c3f3d461f27eaf24cdef623ad08a0f
F test/manydb.test 28385ae2087967aa05c38624cec7d96ec74feb3e
F test/mem5.test c6460fba403c5703141348cd90de1c294188c68f
F test/memdb.test c1f2a343ad14398d5d6debda6ea33e80d0dafcc7
F test/memdb1.test 58d92c2bf622cc5f0f41461e1b35cf64f3f787199544c2c1dada37d88753f9d4
F test/memdb1.test 7b76c3262d63c46dd6b408d18f5721071776f2df4ffeb11e668824e427127594
F test/memleak.test 10b9c6c57e19fc68c32941495e9ba1c50123f6e2
F test/memsubsys1.test 9e7555a22173b8f1c96c281ce289b338fcba2abe8b157f8798ca195bbf1d347e
F test/memsubsys2.test 3e4a8d0c05fd3e5fa92017c64666730a520c7e08
@ -1912,7 +1912,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P ad718388a1f6e25ceba43a40160fac0d9d9d3f26888e98d7b9db478c0b1780be
R 4d3b70fed2c5b14861d4ecb85ec58007
P 5045c8a748f0065638d0ff4f6e3ccd124183fbc518cb9b0418d125b04dbc1491
R cde81bb53fd262e4f921df03755797f7
U drh
Z 70c8a0408ada34ebc0490f884dfe18c7
Z acea419643fa9f724a3b80b1ba776e22

View File

@ -1 +1 @@
5045c8a748f0065638d0ff4f6e3ccd124183fbc518cb9b0418d125b04dbc1491
d91450847a3a3a7217f8f5947adea9a4d12cf77607d40f9724d6ba093919b524

View File

@ -7326,7 +7326,7 @@ int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){
assert( rc==SQLITE_OK );
rc = pagerLockDb(pPager, RESERVED_LOCK);
}
if( rc==SQLITE_OK ){
if( rc==SQLITE_OK && pPager->pVfs->xDelete!=0 ){
sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
}
if( rc==SQLITE_OK && state==PAGER_READER ){

View File

@ -157,6 +157,16 @@ do_execsql_test 410 {
PRAGMA integrity_check;
SELECT * FROM t4;
} {ok hello world!}
do_execsql_test 420 {
PRAGMA journal_mode=TRUNCATE;
PRAGMA journal_mode=OFF;
PRAGMA journal_mode=DELETE;
PRAGMA journal_mode=WAL;
PRAGMA journal_mode=PERSIST;
PRAGMA journal_mode=MEMORY;
PRAGMA journal_mode=OFF;
PRAGMA journal_mode=DELETE;
} {truncate off delete delete persist memory off delete}
# Deserialize something that is not a database.
#