1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

1207 Commits

Author SHA1 Message Date
stephan
f6ba5a5abf Correct two bugs, dating back to [96ba44946b|2022-12-23], which caused the JS wrappers of sqlite3_bind_text/blob() to severely misbehave. Add missing tests. [bugs:bbb715c3f2a0e989|Bug report 2026-10-19T19:03:55Z].
FossilOrigin-Name: d45943cbaf35f21f72b78aafa88f72830343bfeb3a0198a3af0da063dcf6a707
2026-10-19 21:07:18 +00:00
stephan
c01201027e Wasm build: move wasm-strip to after wasm-opt, at recommendation from an Emscripten ticket. Remove several more uses of -sWASM_BIGINT=1, as described for [cc9457981e2a].
FossilOrigin-Name: c2fc091401aa8c75db5f0c98486d9ee1e54fb6c96ec2dc04eecca41aa26990a1
2026-10-19 18:33:02 +00:00
stephan
16327cc106 JS: resolve a [https://github.com/emscripten-core/emscripten/issues/28016|build regression] triggered by Emscripten 6.0.5+. Remove the -sWASM_BIGINT flag from the build because (A) it's been Emscripten's default for a long time and (B) Emscripten now warns loudly if it's used. Remove a stray build flag from fiddle, inadvertently introduced in [c32cf3e355], which caused it to build in 64-bit mode.
FossilOrigin-Name: cc9457981e2a63d271525b1d891a63dd28b1c2da04777228e27132d7cc743cfa
2026-10-19 18:05:25 +00:00
stephan
55b6ae8606 Apply [5080eb6d7a7a] to a similar case in the JS test suite.
FossilOrigin-Name: 336154a23a2a98df12a2a5e6ef51221acccef4063936cbb48cbb77a24cf1bd26
2026-10-19 15:06:38 +00:00
stephan
d37e0daad3 JS: reject URL arguments which may influence the load path for sqlite3.js and sqlite3.wasm if those values look like they might be remote URLs. sqlite3.mjs (ESM) is unaffected by this. This addresses [bugs:74f052d3d2|bug report 2026-10-19T12:25:33Z] but is a preliminary measure, with follow-ups expected.
FossilOrigin-Name: 5080eb6d7a7a7a5c2cdfd08a766f0e096d0d5536488fcf0b325e7b06a6bdd092
2026-10-19 14:50:22 +00:00
stephan
c8e019ec97 Minor doc-only updates to ext/wasm/README.md and GNUmakefile.
FossilOrigin-Name: 7f6793fe94636e83b851919878d52201002dd9d28ac33f9e9c90d4f7cb1feacf
2026-10-18 10:39:36 +00:00
stephan
40f8f74946 OPFS SAHPool VFS: fix an improbable corner case in which the VFS's in-memory state and its on-disk state could differ with regards to availability of a given SAH if a write failure happens at one very specific point during de-registration of the SAH. Addresses [bugs:432f260aa7|bug report 2026-10-05T17:51:35Z].
FossilOrigin-Name: 837fee6e45464bd3fcb5064cfdb91ec15d7cf0c010106797e28e744c3cb39bbc
2026-10-05 20:26:24 +00:00
stephan
5be47b15c4 Adapt wasm build for emcc's deprecation of-sMEMORY64=1 and -sWASM_BIGINT=1. Enable emcc -sASSERTIONS for fiddle at the suggestion of an emcc OOM error, as that flag makes such errors more informative.
FossilOrigin-Name: 5ca28b4ba3410d69021d4470aeb01f454b4b85e1ed6aa54a1480c53275b868e4
2026-10-04 12:10:08 +00:00
stephan
0caf6b532d SAHPool VFS tweaks contributed off-list by Jure Rotar: hardening against malicious inputs and I/O errors. Truncate to the shorter length when overwriting a db file with a shorter one via importDb(). Correct xOpen() to honor the combination of CREATE/EXCLUSIVE flags.
FossilOrigin-Name: 7af745868b873daacdbb57621201887f80782cef4e10ef24243a15ae88897f0d
2026-10-01 08:13:58 +00:00
stephan
58fddadb23 Remove an extraneous nearly-full-file level of indentation in ext/wasm/tester1.c-pp.js.
FossilOrigin-Name: b838769b4b115518feba1ea1f6a39f49427870cae824ec7225627565ab91de3e
2026-09-30 20:59:50 +00:00
stephan
ca9a8adfa4 Add tests demonstrating kvvfs locking errors across multiple connections to the same storage. Add sqlite3.oo1.Stmt.resetNoThrow() for reasons described in its API docs.
FossilOrigin-Name: 0fed9bcbe2c33d8db5b3500b506bcdfa6a2c718a65bfef4f1d2d21951f6341a8
2026-09-30 19:26:14 +00:00
stephan
c15f5adadb Rework the JS kvvfs xLock(), xUnlock(), xCheckReserved(), and xSleep() analog to the recent opfs-sahpool changes to make it more robust when a given kvvfs store is accessed via multiple handles (all necessarily from the same thread). This does not break anything but also does not prove anything - tests are pending.
FossilOrigin-Name: d0e27fa55b05832dc2ad52d5bdb56e74dae2d95984e0f8f8d1831015c5fcd781
2026-09-30 18:40:09 +00:00
stephan
519e4c23a5 [fa44643f65d6] inadvertently removed its circular-cleanup protection by fixing the finalizer ordering. This check-in fixes that. Spotted in [forum:ba4cb328a7|forum post 2026-09-30T14:59:13Z].
FossilOrigin-Name: 771faec269d786f01fc8d9155fd546d09ea6ca2eba0f0c97e34e795f64719454
2026-09-30 15:46:02 +00:00
stephan
cdbfe6a938 Do not inherit the OPFS SAHPool's xSleep method from the default VFS, as doing so can cause the thread to freeze. This VFS only deals with contention originating in the same thread, so xSleep() needs to be a no-op. Addresses [forum:3f0794c5d8|bug report 2026-09-30T12:52:54Z].
FossilOrigin-Name: c9dd4d88e44a9eae4ea11d0ce5491c7ac2ac2d60a3bc83ed485812234be374da
2026-09-30 13:23:56 +00:00
stephan
f4786666d9 JS: when disposing of a C struct instance, do not unmap the 'pointer' property interceptor until after all client-added finalizers have been called.
FossilOrigin-Name: fa44643f65d6815c8c21ec25e7aa6e39a00fdc818d1d058e03123042e45884e1
2026-09-30 13:18:14 +00:00
stephan
3b28aa1ce7 Fix the OPFS SAHPool VFS's xLock/xUnlock to properly deal with multiple handles to the same underlying file within the same JS thread. Addresses [forum:5e66a600ba6e57de|bug report 2026-09-30T10:49:15Z]. Also (unrelated but code-adjacent) make sure that the VFS releases all of its internal mappings when it's paused.
FossilOrigin-Name: 9e2caaa382cee5d5df26ad3af7d727ab3f68a912e39655ffcc52f592d5a08a8d
2026-09-30 11:48:29 +00:00
stephan
737c12a04c Minor JS doc correction.
FossilOrigin-Name: 6b470917b2c9ab25d1e7fed56f19f37b5c2fc3f2a3d504a752a7bb2db14a3ee6
2026-09-30 10:36:27 +00:00
stephan
9fd5a0bc55 Correct the xCheckReserveLock() impl of the OPFS SAHPool VFS to fix a corruption case involving multiple handles in the same JS thread to the same filename when one leaves a journal behind. Addresses [forum:b2fbb61642|bug report 2026-09-29T18:25:28Z].
FossilOrigin-Name: 9168a6f1bedba87117169d096f9a6fcadaac65249d707193e4bcbc25e59ccb54
2026-09-30 09:53:09 +00:00
stephan
226a2c0d6a Generic internal JS cleanups. No functional changes. Update the preprocessor for the ability to use C-style comments in directive arguments.
FossilOrigin-Name: b2699eb9676e6f5459b8279661c264ba2c803ae133f85c703984deb7afa4fe60
2026-09-30 09:17:12 +00:00
stephan
ad1bbfc2bd OPFS SAHPool: more cleanly handle an init failure. Add an init option which tells it not to wipe the storage if initialization fails. Based on the discussion and patch in [forum:5664cd4baee50236|forum post 5664cd4b]. Minor doc updates in unrelated code.
FossilOrigin-Name: 0560c3cc20f60caee42492e4d2063aed8d8d44b0a544a8c3aae56ee67da2e4a7
2026-09-29 08:31:55 +00:00
stephan
998173efcd Update some long-dormant JS test code for refactoring-/renaming breakage induced since it was last used. Remove a separate long-dormant JS demo which cannot work with the current code.
FossilOrigin-Name: fc4e246dc26f3e3872dde42ceefcea70ba4158a92ba94361656b2ca0f4e3ef92
2026-09-26 06:23:08 +00:00
stephan
a8d1f1ff12 Fix a small potential buffer overwrite in the JS impl of kvvfs to resolve [bugs:8d4fe4cc4c|bug report 2026-09-23T10:50:46Z]. Remove some adjacent dead code.
FossilOrigin-Name: c43287d8855b3f9a4621545793ecb2a89ef456d563d8377f2b243812e6acb2b3
2026-09-23 14:00:07 +00:00
stephan
6ceffc33fe Preprocessor: remove more not-relevant-to-this-copy pieces and add support for C-style comments in directive arguments.
FossilOrigin-Name: 5c321483e07c09271e5a59209cdb7c6748e6525c351c5e7aeeb259eba4ea3e70
2026-09-23 10:06:30 +00:00
stephan
fde3a84ddd Latest preprocessor for various cleanups and fixes. Duplicate the tester1 concurrency warning in the worker-based copy.
FossilOrigin-Name: c9b4695ffae5a3388a49643d6819355851a0fda362cdaf140c59fc934759dcac
2026-09-21 20:18:51 +00:00
stephan
c908175cbe Add new test cases for the sqlite3.oo1.Stmt.get() overloads which take both a client-specified type ID and an array or object target.
FossilOrigin-Name: 24bddf2aff01962a35c42422e322c12582ea77e2c7ddd5f8754d12c454ce8a1d
2026-09-21 07:29:41 +00:00
stephan
ae9c436852 User new, more compare JS syntax in a couple of places. No functional changes.
FossilOrigin-Name: 0d747adadf56a0aa3bd5666954a9f7c75c394254dbb938f28ddcd987ffff01b2
2026-09-19 08:13:27 +00:00
stephan
46c7da50b3 Minor internal API doc update.
FossilOrigin-Name: 346c56e02c39858b4364e4c8b8e4c88237e64470066ebb2687ae06d2b0e978b8
2026-09-18 08:00:34 +00:00
stephan
d457639847 Performance improvements in some of the JS sqlite3.oo1 APIs, based on analysis and suggestions from Jure Rotar.
FossilOrigin-Name: 8c6c586c3e42dd1d0af4f374b01a660bfc6afb47fd3b34cd7ef16c198ec66d0a
2026-09-18 07:56:22 +00:00
stephan
5a04cfc091 Add a note to ext/wasm/tester1 about running tests in concurrent tabs.
FossilOrigin-Name: 8ce64bed3bac4038b2fd96758d4bd92cb26ac515ec50cbfc94ef296e5c6fe558
2026-09-18 07:55:02 +00:00
stephan
6f5c0659c2 Typo fix in JS test code.
FossilOrigin-Name: 4630ee80dcb69588ec1c88d049e313b53258e7e23fc0209ac505c92b3bc85c63
2026-09-16 08:31:09 +00:00
stephan
4ebc78674d Add a JavaScript switch/case break which does not actually change any behavior but has the potential to (A) confuse someone into thinking it's broken or (B) become broken via future code changes. Spotted in [https://github.com/sqlite/sqlite/pull/37|a PR in the sqlite github repository].
FossilOrigin-Name: a6351d0413572cf92f9d5eaf01e8777001646961cc77dd5823ca26f7a84a60f3
2026-09-15 18:11:22 +00:00
stephan
912706d94a Latest upstream libcmpp.c for #eval and #include -resolve, and removal of the clumsy @'string' literals.
FossilOrigin-Name: dc176e433555fc818fb20218d846f06477305e6524dc1d73f175de9efccb3428
2026-08-20 11:50:33 +00:00
stephan
cde725f23c Remove some stray debug output and obsolete bug-hunting comments. No functional changes.
FossilOrigin-Name: 41443d5ffe1f6852f447181071a0d9dac89df51c836d16b1bd9420a8513d2ec2
2026-08-10 12:45:11 +00:00
stephan
e9930003c1 Expose the sqlite3_backup APIs to JavaScript.
FossilOrigin-Name: fa17d89f76d50c153b6ff7ca96ae06c1ddc130abc3c0056dac3ef6d66f4f40c5
2026-08-10 12:41:17 +00:00
stephan
3d0687bade Disable Module.instantiateWasm() in node builds to match branch-3.53's behavior. Fix a sqlite3_backup test (duplicate finalize). The aforementioned world-breaking bug was caused by my browser having gotten into a funky state and needing a restart.
FossilOrigin-Name: 7d77bb088641881fca7a625d9828503d269d0ca1e245583a2dcf24a4f09390f5
2026-08-10 12:35:49 +00:00
stephan
961cc1ec09 Add tests for the sqlite3_backup JS bindings but they are disabled while tracking down an unrelated problem which prevents those tests from working (most of the sqlite3.capi methods are being mis-mapped to the sqlite3InitModule function for reasons unimaginable).
FossilOrigin-Name: cb610a8a87cfd29d70ab6b825b4a43d44fd801feecfda1bf4fb7ae181806d84b
2026-08-10 12:18:07 +00:00
stephan
6e93c8c5f1 Fix a circular dep generated by mkwasmbuilds.c
FossilOrigin-Name: f2514ace13c3bcc2ae1d39546fb095676c3540ec8fff6f3f194339660151fc77
2026-08-10 11:51:20 +00:00
stephan
46441db7e8 Merge trunk into the js-backup-bindings branch.
FossilOrigin-Name: 692c4e8ad81f142a454c2038fcdc83317dbaeb71dd6d0497edb4621297c2e35c
2026-08-10 11:23:29 +00:00
stephan
d0afe9c60b Lower the range of inputs accepted by the pstack allocator to address [bugs:4dbd096fe335f974dbd096fe3|/bugs/4dbd096fe335].
FossilOrigin-Name: fafefb59481530255a881f22b1f75b587731867d00eabea39eaec7da2199fdff
2026-08-07 05:31:08 +00:00
stephan
7dc844581a Strip out 42kb of ext/wasm/libcmpp.c (build tool) by using a destilled build shorn of the capabilities we don't use in this tree, like #pipe and loadable modules.
FossilOrigin-Name: 3ec42b829e8de23f8d050b49b48eac1220463156eb973fd4daff440e6183c868
2026-08-05 15:00:54 +00:00
stephan
648be9e67f Update ext/wasm/libcmpp.c for build portability improvements and doc updates.
FossilOrigin-Name: 48fdf51b53e9314f938fb0107ba04f6051d6c47b743c47e30c18a1be0da4015c
2026-07-30 12:17:33 +00:00
stephan
77ef17960c Add long-missing sqlite3_backup bindings to JS/WASM, in response to [forum:dc96ed27b3fdb202|forum thread dc96ed27b3]. This does not yet include tests.
FossilOrigin-Name: 90e599757416059044c643121631fc56eab2b6eea76d04b2d99eae49b8adef44
2026-07-29 12:51:52 +00:00
stephan
53d99267bb Add a JS test for [d5d8ee76d3] resp. [012550c089].
FossilOrigin-Name: f28494eeafc37320932a932044ecd66b6900632a1eccd45a9f8bed653cee3466
2026-07-26 16:05:47 +00:00
stephan
76a15f2b95 Factor an extranous local var out of the previous check-in.
FossilOrigin-Name: 422b4303dae214e23a53b181e5cdf7888d159da33e1675fd8317cbe66834b78e
2026-07-26 15:56:06 +00:00
stephan
bdde38eb0c Remove some extraneous I/O in kvvfs. Reported off-list by Jure Rotar.
FossilOrigin-Name: ce09bfe406728312761a9f227b3f82cbee7cc176dddac1a499e10480a7ee2c1c
2026-07-26 15:47:56 +00:00
stephan
fdb802581c Fix a JS container API misuse in sqlite3.oo1.DB.close() which caused its fallback cleanup of still-open statements to not actually do so. Reported off-list by Jure Rotar.
FossilOrigin-Name: d5d8ee76d337820f765cea7b279f2e5644a24d4f0e76d53b35b4d52277edb767
2026-07-26 15:39:18 +00:00
stephan
70c687859e Fix an error handling case in #base64.
FossilOrigin-Name: f8c408f66257881937ed18b77e274f71dba2d97dd44546372fa0b0a9629efbd2
2026-07-22 14:16:33 +00:00
stephan
7d1796e488 Add (#base64 -f filename) support to the preprocessor and slightly simplify the wasm embedding with it. Fix a bug in the preprocessor's @token@ call expansion when the length of the configured @ is greater than 1 byte.
FossilOrigin-Name: 1e90bedec99054f4856bfb89efc4d676486504db67bd1304c45d14c638ddfc7e
2026-07-22 14:06:41 +00:00
stephan
6ad0fcac94 Random makefile doc updates. No functional changes.
FossilOrigin-Name: 014ef252c7ea404340a5af52a6615cdddd969a4dbf30712fda538550240bb9fc
2026-07-21 20:56:55 +00:00
stephan
04ba5ef30b Random minor doc and formatting cleanups in the wasm makefile generator.
FossilOrigin-Name: a24064919bcc187d5a4d9fa67cb1810fc4e7b9c92596fd2c8e6b0a66bc37e4b3
2026-07-21 20:18:16 +00:00