]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Additional comments explaining what unixIsSharingShmNode() does. No broken-lock-defense-1
authordrh <>
Tue, 28 Oct 2025 01:28:20 +0000 (01:28 +0000)
committerdrh <>
Tue, 28 Oct 2025 01:28:20 +0000 (01:28 +0000)
changes to code.

FossilOrigin-Name: 819fc87385fd5be8a847492478f4c4f247f64edf7c7161b641bfbac6b658bec5

manifest
manifest.uuid
src/os_unix.c

index eec002102bf1f8cec75d145e8b95fba84e46daed..e381e5f1cdabf770dc633f055774fe396950cf67 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Omit\sunnecessary\sbranches\sfrom\sthe\sunixIsSharingShmNode()\simplementation.
-D 2025-10-27T23:57:57.385
+C Additional\scomments\sexplaining\swhat\sunixIsSharingShmNode()\sdoes.\s\sNo\nchanges\sto\scode.
+D 2025-10-28T01:28:20.819
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -720,7 +720,7 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
 F src/os_kv.c fb7ba8d6204197357f1eb7e1c7450d09c10043bf7e99aba602f4aa46b8fb11a3
 F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2
-F src/os_unix.c 46cf48c94280f44e98a58f366b81e27c736b50965a6b72f1099fdb5510f25059
+F src/os_unix.c d4fd1c9bd8948c07071fbf5e4ef827f249b9075f31d3706ecc6481ed4e0ba46d
 F src/os_win.c 27617f334168644b542c9d58ac6e5f051b318136273e78d243384b4eca2df6b3
 F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19
 F src/pager.c 113f9149092ccff6cf90e97c2611200e5a237f13d26c394bc9fd933377852764
@@ -2171,8 +2171,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
 F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 770f35dae47a98554b18f8a7aa9f6b6e39ae2b3aa8dce8d75b5bed0c6f0f9c21
-R 791629cb568e467eb93c82221228da42
+P 2d5623bc27073c407ec63e401f095d12f0025dd276a0bdc26d8b94b1f13c9a36
+R b4fa08ce2106f467a95e7d2084e4ddb2
 U drh
-Z 69e8ca72e4bfcc61d73eb0cfe53aa547
+Z 9fdddb7cbd1691bae27c3687057e444b
 # Remove this line to create a well-formed Fossil manifest.
index b0918c7e64ebd4055319e9edee3e221d4f3f559e..26869b0239f8ec9ee050c1d14dfc9597c9eb174e 100644 (file)
@@ -1 +1 @@
-2d5623bc27073c407ec63e401f095d12f0025dd276a0bdc26d8b94b1f13c9a36
+819fc87385fd5be8a847492478f4c4f247f64edf7c7161b641bfbac6b658bec5
index 0a46fc7cfa254bd126e3631810e2cbaf5b36630d..7a4cfcb15ccab68aea48a756583a665526f76b7b 100644 (file)
@@ -4651,6 +4651,20 @@ static int unixFcntlExternalReader(unixFile *pFile, int *piOut){
 ** then return true.  Return false if either pFile does not have a -shm
 ** file open or if it is the only connection to that -shm file across the
 ** entire system.
+**
+** This routine is not required for correct operation.  It can always return
+** false and SQLite will continue to operate according to spec.  However,
+** when this routine does its job, it adds extra robustness in cases
+** where database file locks have been erroneously deleted in a WAL-mode
+** database by doing close(open(DATABASE_PATHNAME)) or similar.
+**
+** With false negatives, SQLite still operates to spec, though with less
+** robustness.  With false positives, the last database connection on a
+** WAL-mode database will fail to unlink the -wal and -shm files, which
+** is annoying but harmless.  False positives will also prevent a database
+** connection from running "PRAGMA journal_mode=DELETE" in order to take
+** the database out of WAL mode, which is perhaps more serious, but is
+** still not a disaster.
 */
 static int unixIsSharingShmNode(unixFile *pFile){
   int rc;