From: stephan Date: Fri, 14 Mar 2025 11:14:52 +0000 (+0000) Subject: Minor doc corrections for the sahpool-digest fix and merge in current trunk. X-Git-Tag: major-release~185^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5390f95f071ae83d2d89742b7a94ec1bfec6f6ff;p=thirdparty%2Fsqlite.git Minor doc corrections for the sahpool-digest fix and merge in current trunk. FossilOrigin-Name: 500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865 --- 5390f95f071ae83d2d89742b7a94ec1bfec6f6ff diff --cc ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index 81bbcf3c52,95843a35dc..f30df31985 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@@ -79,48 -79,6 +79,48 @@@ globalThis.sqlite3ApiBootstrap.initiali capi.SQLITE_OPEN_MAIN_JOURNAL | capi.SQLITE_OPEN_SUPER_JOURNAL | capi.SQLITE_OPEN_WAL; + const FLAG_COMPUTE_DIGEST_V2 = capi.SQLITE_OPEN_MEMORY + /* Part of the fix for + https://github.com/sqlite/sqlite-wasm/issues/97 + - Summary: prior to versions 3.49.2 and 3.50.0 computeDigest() - always computes a value of [0,0] due to overflows, so it does not - do anything useful. Fixing it invalidates old persistent files, - so we instead only fix it for files created or updated since the - bug was discovered and fixed. ++ Summary: prior to version 3.50.0 computeDigest() always computes ++ a value of [0,0] due to overflows, so it does not do anything ++ useful. Fixing it invalidates old persistent files, so we ++ instead only fix it for files created or updated since the bug ++ was discovered and fixed. + + This flag determines whether we use the broken legacy + computeDigest() or the v2 variant. We only use this flag for + newly-created/overwritten files. Pre-existing files have the + broken digest stored in them so need to continue to use that. + + What this means, in terms of db file compatibility between + versions: + - - DBs created with versions older than this fix (<=3.49.1) ++ - DBs created with versions older than this fix (<3.50.0) + can be read by post-fix versions. Such DBs which are written + to in-place (not replaced) by newer versions can still be read + by older versions, as the affected digest is only modified + when the SAH slot is assigned to a given filename. + + - DBs created with post-fix versions will, when read by a pre-fix + version, be seen as having a "bad digest" and will be + unceremoniously replaced by that pre-fix version. When swapping + back to a post-fix version, that version will see that the file + entry is missing the FLAG_COMPUTE_DIGEST_V2 bit so will treat it + as a legacy file. + - This flag is stored in the same memory as the variour ++ This flag is stored in the same memory as the various + SQLITE_OPEN_... flags and we must be careful here to not use a + flag bit which is otherwise relevant for the VFS. + SQLITE_OPEN_MEMORY is handled by sqlite3_open_v2() and friends, + not the VFS, so we'll repurpose that one. If we take a + currently-unused bit and it ends up, at some later point, being + used, we would have to invalidate existing VFS files in order to + move to another bit. Similarly, if the SQLITE_OPEN_MEMORY bit + were ever reassigned (which it won't be!), we'd invalidate all + VFS-side files. + */; /** Subdirectory of the VFS's space where "opaque" (randomly-named) files are stored. Changing this effectively invalidates the data diff --cc manifest index 4242e0f3d7,d18c8051a4..27398cb278 --- a/manifest +++ b/manifest @@@ -1,5 -1,5 +1,5 @@@ - C Merge\strunk\sinto\sthe\ssahpool-digest\sbranch. - D 2025-02-26T03:32:52.292 -C Cherrypick\sthe\s[2b582c0097e33]\sdoc\saddition,\swhich\swas\sinitially\scommitted\sto\sthe\swrong\sbranch. -D 2025-03-14T09:34:09.128 ++C Minor\sdoc\scorrections\sfor\sthe\ssahpool-digest\sfix\sand\smerge\sin\scurrent\strunk. ++D 2025-03-14T11:14:52.385 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@@ -638,17 -638,17 +638,17 @@@ F ext/wasm/api/post-js-footer.js 365405 F ext/wasm/api/post-js-header.js 53740d824e5d9027eb1e6fd59e216abbd2136740ce260ea5f0699ff2acb0a701 F ext/wasm/api/pre-js.c-pp.js a614a2c82b12c4d96d8e3ba77330329efc53c4d56a8a7e60ade900f341866cfb F ext/wasm/api/sqlite3-api-cleanup.js 3ac1786e461ada63033143be8c3b00b26b939540661f3e839515bb92f2e35359 - F ext/wasm/api/sqlite3-api-glue.c-pp.js 5c0209e6a28164b4c2c1a34b0bb4aee3b7b1a264988d7e71fac08b8ede5b7ae3 + F ext/wasm/api/sqlite3-api-glue.c-pp.js bd8ae059bb3ea489666b2f167025833e55dc5941be99c129a56fc25e541d37ce F ext/wasm/api/sqlite3-api-oo1.c-pp.js f3a8e2004c6625d17946c11f2fb32008be78bc5207bf746fc77d59848813225f - F ext/wasm/api/sqlite3-api-prologue.js 8b79b89a2cac71c2f751c4a16e41ee9f34745ba005040d0e9ae13b49b3fb9445 + F ext/wasm/api/sqlite3-api-prologue.js 6fe109961d51a326ec3de065a4813c5c6928b6c5ae996712327c7dfcf4d42741 F ext/wasm/api/sqlite3-api-worker1.c-pp.js f646a65257973b8c4481f8a6a216370b85644f23e64b126e7ae113570587c0ab F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89 - F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af + F ext/wasm/api/sqlite3-opfs-async-proxy.js 9654b565b346dc609b75d15337f20acfa7af7d9d558da1afeb9b6d8eaa404966 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d - F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 3586e3312375350be0a2e6f7e2ff65d46c66555b933bad66793a53d4c13388f1 -F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 16d80af915bfd2529824b999b304425503094eedf34fb113d0791e002b13e5cf ++F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 25d51a69084931c909a11e6850761ee156d9e243f733a42b221f3f90d70bd5ee F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 4ab0704ee198de7d1059eccedc7703c931510b588d10af0ee36ea5b3ebbac284 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 - F ext/wasm/api/sqlite3-wasm.c 82b74d419a339a4cdb012ac7b6fa2b8c29c71e738669057fbf03d2a99b7d99cd + F ext/wasm/api/sqlite3-wasm.c 6a4cd40267eaf08400895c5b9de39c56976c3b97b3c1bbe53fc2e80fa074e9c7 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js bc65debfe43b81fc39fb25c40ad0cc1946bd82580fbf644351107b544d6177ee F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5 F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7 @@@ -2215,8 -2213,9 +2215,8 @@@ F tool/version-info.c 3b36468a90faf1bbd F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f - P 0df62b776c68bebb0e187b353b6f29b0a41a29f0a1c8d6728fa6b9f7ce0d13f7 1a72d1d13e42f69f02861f8ac3058e69b78d4fd2050ca8c53a1ce016b7e0863d - R d8081122e8a77c5919156f890755d0ba -P 75e72e3b0d0d689d39e00a01dc361dd6ce2649e68d200bf501ddcf04063041b2 -Q +2b582c0097e3374beb280dfa6b03e0dacb9911da1bceb0dce0468e6b7291e74f -R 56a19e59ade4736dd825679ace2bb72a ++P fc1eeb7d1f2880907b0fe71a8c572dd7cd74a5d65ec0177332976ad2f8c2b216 f786de8d1873cd27b1bf83273a1e100e9d481144674888ccf65974e003a3caad ++R 1281ce5a1bf5b175e155c185d7f4bb6f U stephan - Z 32bf09d90a317227f19e916af9e89508 -Z 2c7e1671f57e7e6f44a52a14c045869a ++Z f4da5ec6a61829129290a8d77df27ca0 # Remove this line to create a well-formed Fossil manifest. diff --cc manifest.uuid index 266a3a5ff1,e509045678..0d969c256a --- a/manifest.uuid +++ b/manifest.uuid @@@ -1,1 -1,1 +1,1 @@@ - fc1eeb7d1f2880907b0fe71a8c572dd7cd74a5d65ec0177332976ad2f8c2b216 -f786de8d1873cd27b1bf83273a1e100e9d481144674888ccf65974e003a3caad ++500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865