From f6ec2b5946cc5dd80d56e162360d54baa35812c5 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 11 Jun 2024 20:03:32 +0000 Subject: [PATCH 1/4] Fix a problem with rolling back hot journals using the unix-dotfile VFS. FossilOrigin-Name: 4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9 --- manifest | 19 +++++++------ manifest.uuid | 2 +- src/os_unix.c | 25 ++++++----------- test/lock5.test | 71 +++++++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 86 insertions(+), 31 deletions(-) diff --git a/manifest b/manifest index 2724500b35..dbd86925eb 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\ssome\sdead\sJS\scode\sand\supdate\ssome\sJS\sdocs. -D 2024-06-11T17:04:43.812 +C Fix\sa\sproblem\swith\srolling\sback\shot\sjournals\susing\sthe\sunix-dotfile\sVFS. +D 2024-06-11T20:03:32.695 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -739,7 +739,7 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06 F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 -F src/os_unix.c 08ca53844f4bf8eafb18b0a9076c84afac41da912315a5cfbe9e704d4c10c090 +F src/os_unix.c 582eb7e4aa4fee66dd9475cf7325a6753890266020ba1670c36ed8b9babd5a46 F src/os_win.c 6ff43bac175bd9ed79e7c0f96840b139f2f51d01689a638fd05128becf94908a F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 9beb80f6e330dd63c5d8ba0f7a7f3a55fff22067a68d424949c389bfc6fa0c56 @@ -1388,7 +1388,7 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8 -F test/lock5.test c6c5e0ebcb21c61a572870cc86c0cb9f14cede38 +F test/lock5.test 69d7991e39c3fade9b6e46403c1386bcd21a4808796c9c6f60f17d0fdcec266f F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413 @@ -2195,8 +2195,11 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 06e6f64533563ab9c059b773e5f0d78085df716f2624e547b7259f6789c3ffe0 -R 79d342ace6fd539450d6954e121ef97a -U stephan -Z 878c1bfba19ab8a7570c53af656f275c +P 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580 +R a6be376671415b32f13dc00f1cf159ee +T *branch * unix-dotfile-fix +T *sym-unix-dotfile-fix * +T -sym-trunk * +U dan +Z 82729b2f1037b9035a8ecef1ba94fcd8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 214309359d..78f90430a4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580 \ No newline at end of file +4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index c61b19060c..45ba0c001d 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2279,26 +2279,17 @@ static int nolockClose(sqlite3_file *id) { /* ** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. -** -** In dotfile locking, either a lock exists or it does not. So in this -** variation of CheckReservedLock(), *pResOut is set to true if any lock -** is held on the file and false if the file is unlocked. +** file by this or any other process. The caller always holds a SHARED +** lock when it is called. This means that no other connection could +** hold a RESERVED lock, as unix-dotfile uses just a single exclusive lock - +** the presence of the dotfile - for all 4 VFS locks. So this function sets +** (*pResOut) to 0 (no other connection holds RESERVED) and returns SQLITE_OK. */ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { - int rc = SQLITE_OK; - int reserved = 0; - unixFile *pFile = (unixFile*)id; - SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - - assert( pFile ); - reserved = osAccess((const char*)pFile->lockingContext, 0)==0; - OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, rc, reserved)); - *pResOut = reserved; - return rc; + assert( ((unixFile*)id)->eFileLock>=SHARED_LOCK ); + *pResOut = 0; + return SQLITE_OK; } /* diff --git a/test/lock5.test b/test/lock5.test index 99214afb19..6e26f9dd02 100644 --- a/test/lock5.test +++ b/test/lock5.test @@ -11,10 +11,10 @@ # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock5.test,v 1.6 2008/12/04 12:34:16 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl +set testprefix lock5 # This file is only run if using the unix backend compiled with the # SQLITE_ENABLE_LOCKING_STYLE macro. @@ -101,10 +101,7 @@ do_test lock5-dotfile.X { ##################################################################### forcedelete test.db -if {[catch {sqlite3 db test.db -vfs unix-flock} msg]} { - finish_test - return -} +if {0==[catch {sqlite3 db test.db -vfs unix-flock} msg]} { do_test lock5-flock.1 { sqlite3 db test.db -vfs unix-flock @@ -149,13 +146,19 @@ do_test lock5-flock.8 { db2 close } {} +} + ##################################################################### +reset_db + do_test lock5-none.1 { sqlite3 db test.db -vfs unix-none sqlite3 db2 test.db -vfs unix-none execsql { PRAGMA mmap_size = 0 } db2 execsql { + CREATE TABLE t1(a, b); + INSERT INTO t1 VALUES(1, 2); BEGIN; INSERT INTO t1 VALUES(3, 4); } @@ -193,4 +196,62 @@ ifcapable lock_proxy_pragmas { set env(SQLITE_FORCE_PROXY_LOCKING) $::using_proxy } +##################################################################### +reset_db + +# 1. Create a large database using the unix-dotfile VFS +# 2. Write a large transaction to the db, so that the cache spills, but do +# not commit it. +# 3. Make a copy of the database files on disk. +# 4. Try to read from the copy using unix-dotfile VFS. This fails because +# the dotfile still exists, so SQLite things the database is locked. +# 5. Remove the dotfile. +# 6. Try to read the db again. This time, the old transaction is rolled +# back and the read permitted. +# +do_test 2.dotfile.1 { + sqlite3 db test.db -vfs unix-dotfile + execsql { + PRAGMA cache_size = 10; + CREATE TABLE t1(x, y, z); + CREATE INDEX t1x ON t1(x); + WITH s(i) AS ( + SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 + ) + INSERT INTO t1 SELECT hex(randomblob(20)), hex(randomblob(500)), i FROM s; + } +} {} + +do_execsql_test 2.dotfile.2 { + BEGIN; + UPDATE t1 SET z=z+1, x=hex(randomblob(20)); +} + +do_test 2.dotfile.3 { + list \ + [file exists test.db] \ + [file exists test.db-journal] \ + [file exists test.db.lock] +} {1 1 1} + +do_test 2.dotfile.4 { + forcecopy test.db test.db2 + forcecopy test.db-journal test.db2-journal + file mkdir test.db2.lock + + sqlite3 db2 test.db2 -vfs unix-dotfile + catchsql { + SELECT count(*) FROM t1; + } db2 +} {1 {database is locked}} + +do_test 2.dotfile.5 { + file delete test.db2.lock + execsql { + PRAGMA integrity_check + } db2 +} {ok} + finish_test + + From 41caf1cdfa71e4c32aa441be900d422ad59676f2 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 11 Jun 2024 20:28:56 +0000 Subject: [PATCH 2/4] Handle the case where unix-dotfile is used with URI parameter nolock=1. FossilOrigin-Name: 3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90 --- manifest | 17 +++++++---------- manifest.uuid | 2 +- src/os_unix.c | 19 ++++++++++++------- test/lock5.test | 12 ++++++++++++ 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/manifest b/manifest index dbd86925eb..cf3caa1cb2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\swith\srolling\sback\shot\sjournals\susing\sthe\sunix-dotfile\sVFS. -D 2024-06-11T20:03:32.695 +C Handle\sthe\scase\swhere\sunix-dotfile\sis\sused\swith\sURI\sparameter\snolock=1. +D 2024-06-11T20:28:56.529 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -739,7 +739,7 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06 F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 -F src/os_unix.c 582eb7e4aa4fee66dd9475cf7325a6753890266020ba1670c36ed8b9babd5a46 +F src/os_unix.c 2ea8d3ed496b8d1f9332a9505653424e5464fd797ea9d91f8e2e62f9dd0298d0 F src/os_win.c 6ff43bac175bd9ed79e7c0f96840b139f2f51d01689a638fd05128becf94908a F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 9beb80f6e330dd63c5d8ba0f7a7f3a55fff22067a68d424949c389bfc6fa0c56 @@ -1388,7 +1388,7 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8 -F test/lock5.test 69d7991e39c3fade9b6e46403c1386bcd21a4808796c9c6f60f17d0fdcec266f +F test/lock5.test e6d5a7dd3c3c2ad83b05dbd50d0bd8b2a98a13ce6b2f3297e0edfbebb3413de3 F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413 @@ -2195,11 +2195,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580 -R a6be376671415b32f13dc00f1cf159ee -T *branch * unix-dotfile-fix -T *sym-unix-dotfile-fix * -T -sym-trunk * +P 4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9 +R f4ac66d6cce3f1556fd45b9db23cb700 U dan -Z 82729b2f1037b9035a8ecef1ba94fcd8 +Z 59b7d2f0f8fc06cadab577170f885282 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 78f90430a4..48f2de2bc7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9 \ No newline at end of file +3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90 \ No newline at end of file diff --git a/src/os_unix.c b/src/os_unix.c index 45ba0c001d..c94c0c111f 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -2279,16 +2279,21 @@ static int nolockClose(sqlite3_file *id) { /* ** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. The caller always holds a SHARED -** lock when it is called. This means that no other connection could -** hold a RESERVED lock, as unix-dotfile uses just a single exclusive lock - -** the presence of the dotfile - for all 4 VFS locks. So this function sets -** (*pResOut) to 0 (no other connection holds RESERVED) and returns SQLITE_OK. +** file by this or any other process. If the caller holds a SHARED +** or greater lock when it is called, then it is assumed that no other +** client may hold RESERVED. Or, if the caller holds no lock, then it +** is assumed another client holds RESERVED if the lock-file exists. */ static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { + unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - assert( ((unixFile*)id)->eFileLock>=SHARED_LOCK ); - *pResOut = 0; + + if( pFile->eFileLock>=SHARED_LOCK ){ + *pResOut = 0; + }else{ + *pResOut = osAccess((const char*)pFile->lockingContext, 0)==0; + } + OSTRACE(("TEST WR-LOCK %d %d %d (dotlock)\n", pFile->h, 0, *pResOut)); return SQLITE_OK; } diff --git a/test/lock5.test b/test/lock5.test index 6e26f9dd02..0e1669f1b1 100644 --- a/test/lock5.test +++ b/test/lock5.test @@ -252,6 +252,18 @@ do_test 2.dotfile.5 { } db2 } {ok} +db2 close + +do_test 2.dotfile.6 { + forcecopy test.db test.db2 + forcecopy test.db-journal test.db2-journal + + sqlite3 db2 file:test.db2?nolock=1 -vfs unix-dotfile -uri 1 + catchsql { + SELECT count(*) FROM t1; + } db2 +} {0 1000} + finish_test From f8ed7db472f51b7dac3a220181bb5f6c2bae8b49 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 12 Jun 2024 11:41:18 +0000 Subject: [PATCH 3/4] Do not attempt to run hot journal rollback tests in lock5.test with the "inmemory_journal" permutation, which cannot generate hot journals. FossilOrigin-Name: 1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4 --- manifest | 12 ++--- manifest.uuid | 2 +- test/lock5.test | 128 ++++++++++++++++++++++++------------------------ 3 files changed, 72 insertions(+), 70 deletions(-) diff --git a/manifest b/manifest index cf3caa1cb2..a103a7194a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Handle\sthe\scase\swhere\sunix-dotfile\sis\sused\swith\sURI\sparameter\snolock=1. -D 2024-06-11T20:28:56.529 +C Do\snot\sattempt\sto\srun\shot\sjournal\srollback\stests\sin\slock5.test\swith\sthe\s"inmemory_journal"\spermutation,\swhich\scannot\sgenerate\shot\sjournals. +D 2024-06-12T11:41:18.217 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1388,7 +1388,7 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8 -F test/lock5.test e6d5a7dd3c3c2ad83b05dbd50d0bd8b2a98a13ce6b2f3297e0edfbebb3413de3 +F test/lock5.test 02e00537ed5bea94d74e914a579cd94b9b52b342361d9ea270a8630e62bb131d F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413 @@ -2195,8 +2195,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9 -R f4ac66d6cce3f1556fd45b9db23cb700 +P 3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90 +R 78b8c4cb68d9ed22c3978516f0902770 U dan -Z 59b7d2f0f8fc06cadab577170f885282 +Z 84fe133e30abe6e15019a66820115796 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 48f2de2bc7..23427501e7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90 \ No newline at end of file +1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4 \ No newline at end of file diff --git a/test/lock5.test b/test/lock5.test index 0e1669f1b1..0141cd74c0 100644 --- a/test/lock5.test +++ b/test/lock5.test @@ -198,72 +198,74 @@ ifcapable lock_proxy_pragmas { ##################################################################### reset_db - -# 1. Create a large database using the unix-dotfile VFS -# 2. Write a large transaction to the db, so that the cache spills, but do -# not commit it. -# 3. Make a copy of the database files on disk. -# 4. Try to read from the copy using unix-dotfile VFS. This fails because -# the dotfile still exists, so SQLite things the database is locked. -# 5. Remove the dotfile. -# 6. Try to read the db again. This time, the old transaction is rolled -# back and the read permitted. -# -do_test 2.dotfile.1 { - sqlite3 db test.db -vfs unix-dotfile - execsql { - PRAGMA cache_size = 10; - CREATE TABLE t1(x, y, z); - CREATE INDEX t1x ON t1(x); - WITH s(i) AS ( - SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 - ) - INSERT INTO t1 SELECT hex(randomblob(20)), hex(randomblob(500)), i FROM s; +if {[permutation]!="inmemory_journal"} { + + # 1. Create a large database using the unix-dotfile VFS + # 2. Write a large transaction to the db, so that the cache spills, but do + # not commit it. + # 3. Make a copy of the database files on disk. + # 4. Try to read from the copy using unix-dotfile VFS. This fails because + # the dotfile still exists, so SQLite things the database is locked. + # 5. Remove the dotfile. + # 6. Try to read the db again. This time, the old transaction is rolled + # back and the read permitted. + # + do_test 2.dotfile.1 { + sqlite3 db test.db -vfs unix-dotfile + execsql { + PRAGMA cache_size = 10; + CREATE TABLE t1(x, y, z); + CREATE INDEX t1x ON t1(x); + WITH s(i) AS ( + SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 + ) + INSERT INTO t1 SELECT hex(randomblob(20)), hex(randomblob(500)), i FROM s; + } + } {} + + do_execsql_test 2.dotfile.2 { + BEGIN; + UPDATE t1 SET z=z+1, x=hex(randomblob(20)); } -} {} - -do_execsql_test 2.dotfile.2 { - BEGIN; - UPDATE t1 SET z=z+1, x=hex(randomblob(20)); + + do_test 2.dotfile.3 { + list \ + [file exists test.db] \ + [file exists test.db-journal] \ + [file exists test.db.lock] + } {1 1 1} + + do_test 2.dotfile.4 { + forcecopy test.db test.db2 + forcecopy test.db-journal test.db2-journal + file mkdir test.db2.lock + + sqlite3 db2 test.db2 -vfs unix-dotfile + catchsql { + SELECT count(*) FROM t1; + } db2 + } {1 {database is locked}} + + do_test 2.dotfile.5 { + file delete test.db2.lock + execsql { + PRAGMA integrity_check + } db2 + } {ok} + + db2 close + + do_test 2.dotfile.6 { + forcecopy test.db test.db2 + forcecopy test.db-journal test.db2-journal + + sqlite3 db2 file:test.db2?nolock=1 -vfs unix-dotfile -uri 1 + catchsql { + SELECT count(*) FROM t1; + } db2 + } {0 1000} } -do_test 2.dotfile.3 { - list \ - [file exists test.db] \ - [file exists test.db-journal] \ - [file exists test.db.lock] -} {1 1 1} - -do_test 2.dotfile.4 { - forcecopy test.db test.db2 - forcecopy test.db-journal test.db2-journal - file mkdir test.db2.lock - - sqlite3 db2 test.db2 -vfs unix-dotfile - catchsql { - SELECT count(*) FROM t1; - } db2 -} {1 {database is locked}} - -do_test 2.dotfile.5 { - file delete test.db2.lock - execsql { - PRAGMA integrity_check - } db2 -} {ok} - -db2 close - -do_test 2.dotfile.6 { - forcecopy test.db test.db2 - forcecopy test.db-journal test.db2-journal - - sqlite3 db2 file:test.db2?nolock=1 -vfs unix-dotfile -uri 1 - catchsql { - SELECT count(*) FROM t1; - } db2 -} {0 1000} - finish_test From 9e72ea5ddcf8da7450185d136354c22956cc0845 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 12 Jun 2024 15:29:37 +0000 Subject: [PATCH 4/4] Omit tests that depend on sqlite3_release_memory() in lock5.test when running the memsubsys1 or memsubsys2 permutations. FossilOrigin-Name: 9d63033bf46ddf0f4d9d4ef06d56357fe6165f2370cd19cf81c2f7f61ce224fc --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/lock5.test | 10 ++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/manifest b/manifest index a103a7194a..f681404f14 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sattempt\sto\srun\shot\sjournal\srollback\stests\sin\slock5.test\swith\sthe\s"inmemory_journal"\spermutation,\swhich\scannot\sgenerate\shot\sjournals. -D 2024-06-12T11:41:18.217 +C Omit\stests\sthat\sdepend\son\ssqlite3_release_memory()\sin\slock5.test\swhen\srunning\sthe\smemsubsys1\sor\smemsubsys2\spermutations. +D 2024-06-12T15:29:37.134 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1388,7 +1388,7 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00 F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8 -F test/lock5.test 02e00537ed5bea94d74e914a579cd94b9b52b342361d9ea270a8630e62bb131d +F test/lock5.test 626571313daef2c949ce002f861042d63d81119fa62a9e999721c8bbd85e1ec9 F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5 F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431 F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413 @@ -2195,8 +2195,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90 -R 78b8c4cb68d9ed22c3978516f0902770 +P 1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4 +R 3a4a85834551db124c9a29a9adb094ef U dan -Z 84fe133e30abe6e15019a66820115796 +Z c34dc91d8750434d9c55abc5758418d0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 23427501e7..cc3da9aa52 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4 \ No newline at end of file +9d63033bf46ddf0f4d9d4ef06d56357fe6165f2370cd19cf81c2f7f61ce224fc \ No newline at end of file diff --git a/test/lock5.test b/test/lock5.test index 0141cd74c0..d5950118ce 100644 --- a/test/lock5.test +++ b/test/lock5.test @@ -181,10 +181,12 @@ do_test lock5-none.5 { } {1 2} ifcapable memorymanage { - do_test lock5-none.6 { - sqlite3_release_memory 1000000 - execsql {SELECT * FROM t1} db2 - } {1 2 3 4} + if {[permutation]!="memsubsys1" && [permutation]!="memsubsys2"} { + do_test lock5-none.6 { + sqlite3_release_memory 1000000 + execsql {SELECT * FROM t1} db2 + } {1 2 3 4} + } } do_test lock5-none.X {